Ruby on Rails and gmap location - ruby-on-rails

I come here to ask you some informations or maybe help to try to do what i want.
Here it's what i want to realize:
I have a website and on it i have some places in database (with lattitude and longitude saved). I want allow users, when they click on a button, display a map with a marker on their actual position and others markers who will represent the places from the database near them.
I found some tools like google map API v3. With it i can show the user position but i don't know how i can display the position of the places store in my database.
If you have any ideas or examples.
Thank you.
(PS: Sorry for my english)

I built a similar app with Spring and Java. What you'll have to do is create Placemark JS objects and pass them to the Google Maps API. You can also pass a map size to determine the scope of the map returned to the user.
In order to determine nearby locations, simply build some ruby/rails code to limit the distance of locations from the user location.
Get user location
Determine which locations to show on map within your rails app
Pass desired placemarks to Google Maps (This can be found in API docs which are great)
Display the map returned by Google Maps on a view.

I think you could use geocoder gem for that:
http://www.rubygeocoder.com/

Related

Google maps how far postcode is from fixed location Ruby on rails 4

Hello I've been looking around and am unable to find any information on how to implement google maps into my rails application.
What I want to achieve is a page where the the map is shown on the screen with a fixed marker location of a shop. The user is able to type in their postcode and the map shows the distance between the two locations.
Could I please get some help with this :)
Theres a gem for that
https://github.com/apneadiving/Google-Maps-for-Rails
Or just insert it into script tags onto your page
https://developers.google.com/maps/documentation/javascript/tutorial

Google Maps for iOS SDK - How to display a location via a name?

Using the web version of Google Maps, I can enter a general place, like a neighborhood, and it will show that neighborhood, with its borders directly highlighted. Like this:
I want to be able to do this using the iOS SDK. However, I cannot determine through the documentation how to load a location by means other than a Lat/Long. Does this require the use of the Places API to work? If so, how?
Once I am able to display this, I want to display the user's current location on the screen, but keep the frame locked to the neighborhood. Basically, it will indicate to the user when they have wandered outside the specified area.
The Google Maps Api does NOT return neighborhood boundaries. You will have to build your own API for that.
If you're interested in NYC neighborhoods - I would contact the owner of locality.nyc - he can provide you with an API for that.

search nearby places from database [swift]

I am developing an app which allows users to search nearby place according to the radius provided by the user. I have some places stored in a realm database with the latitude and longitude of that place. I am able to get the users current latitude and longitude but i don't know how to implement the logic to present the user with places that are closest to him. I can calculate the distance between users current location and a particular location using CLLocationDistance = currentlocation.distanceFromLocation(destinationLocation).
Please point me in the right direction or provide me with a sample code.
If it's not possible with Realm then let me know which database solution is the best option.
This isn't currently possible in native Realm queries, but it's something that's actively being worked on! (see https://github.com/realm/realm-cocoa/pull/2199 for a current pull request)

iOS MKMapView filter all Museums

I was trying to display a MKMapView showing all the museums in a city. I haven't understood if this is a built in feature of the maps or I need to get the data somewhere else. Online I was seeing an example of government databases providing the information and location and then this was being added to the map. Does the map have this feature built in?
Nope, this is not built-in feature of the map (in apple map). But you have to make a filter (Query) that can fetch response what you needs (response will be in JSON format) and manipulate it in your map as a Annotaion.

Locating closest GPS marker from Geonames database

I am developing an Android application that uses the geonames.org database. I only use the city/populated place category and their corresponding coordinates as provided by geonames.
I want the user to be able to provide his/her GPS coordinates and get a result back with the closest cities/populated places and their coordinates.
Even if the user is in a city I want that city's coordinates to be displayed along with the more distant ones.
Can this be done without the help of google or a web service? I might host the world city geolocations on my own server.
Thanks!
Since posting this I have found the answer to my own question. MongoDB supports geospatial indexing. Make sure that the longitude and latitude field is saved in one string and point the geospatial index to your loc: field. You can then perform queries with a bounding box to find closest locations within a certain radius for example. More about MongoDB geospatial indexing can be found here: http://www.mongodb.org/display/DOCS/Geospatial+Indexing

Resources