On the old version of Google Maps I used to be able to add locations such as this into the directions:
Niter Ice Cave#42.53263,-111.72658
This allowed users to give a friendly name to the co-ordinates. Google used the co-ordinates given to place the point on the map and used the name in the directions.
When I try to do this on the new Google Maps it gives me an error message (either "I do not know what that means" or "Couldn't find the exact location so using an approximate location instead" or something along those lines). If I use just the co-ordinates Google (obviously) finds the location fine but I am left with the unfriendly 42.53263,-111.72658 in the directions list.
Is this yet another feature Google has removed or can naming co-ordinates still be done (but by another method)? If the naming of co-ordinates can still be done, how do you do it?
Related
I have build employee location history tracking app in Ionic 4.
The process is as follows:
1- There is a service which fetches the current location after 5 second
2- Upload the fetched coordinates to database
But sometimes the location fetched is incorrect i.e 4-5 meters away from where the current employee is. I dont know why is this happening even though I am using accurate location fetching.
Anyway,
In admin panel, I draw the polygon on Google map from the coordinates which were saved.
As you can see the polygon and the whole track is quite weird.
Is there any way to draw the lines as we get in directions API?
Or something like trailing line drawn like this in life360 App.
I want the history locations to be drawn quite smoothly on maps instead of weird polygons line which doesnt bother the roads and paths
You can use the Directions API. Input all the points as waypoints and the response will contain an encoded polyline that will be on actual roads and look nicer than a polyline.
https://developers.google.com/maps/documentation/directions/
I'm using Google Maps for my campus map and I already have all the overlays for the buildings done along with javascript to open windows when clicked on the overlay, etc. The next problem I'm trying to tackle is how to get directions from point A to point B (using point A as geolocation). On my campus there is about 2.5 miles+ of sidewalks but they aren't defined paths in google maps, so i cannot use the built in directions which Google maps offers.
Is there any way i can make it so it displays directions from point A to point B while making it so it displays a path along a sidewalk?
Thanks in advance.
EDIT: I already have the geolocation working also.
If Google doesn't know about the sidewalks, you will have to do the drawing yourself. You will need to store information about the sidewalks in a database, then come up with a routing algorithm, then draw a line (using the Polyline class).
For routing algorithms, you might be able to get away with using Dijkstra's algorithm
http://en.wikipedia.org/wiki/Dijkstra%27s_algorithm
or you could try A*
http://en.wikipedia.org/wiki/A*_search_algorithm
or one of the other algorithms you can find in the Wikipedia sidebar on the Dijkstra and A* pages.
Polyline documentation:
https://developers.google.com/maps/documentation/javascript/overlays#Polylines
Really quick/simple question that will determine which map API i use for my project.
I dont need an example- ill figure that out, i just need to know if the capabilities are there.
If i have store geocode (latitude, longitude) coordinates in a database, can i put one of those little red markers on a google map without having to actually make a geocoding request from google?
Additional question:
Also, would it count towards any quotas every time i display one of their maps, even if i give them the geocoded coordinates? Because i mean technically their map still has to find those coordinates...
Q1: Yes — you tell the API the coordinates of where to put the marker, rather than get Google to find those coordinates.
Q2: The usage limits are published by Google. You can have up to 25000 map loads per day. If you don't use the geocoder because you provide the coordinates yourself, then you don't use a geocoder access.
I'm looking for a solution to be able determine landscape type by a given coordinate, for example check if current position is water/forest/town/road and so on. I found google.maps.MapTypeStyleElementType object specification in the Google Maps specification, but not sure if it could help me or not.
Probably, there are some another Maps API with such functioality? Or maybe I should refer to the different types of offline maps?
Nope, the link you send is just for styling the proper features, not to tell which feature is at a given coordinate. If you are interested in landscape, then Corine Land Cover is the thing you are looking for. It describes the types of biotops like forest, water, but also land use - meadow, field, buildings etc. However, I don't know if there is such an online service where you could query particular coordinates. Other solution for you would be to import these GIS layers (they are freely available) to your own gis map server. Maybe this is partially solved as there are e.g. projects how to incorporate these into openstreetmap.
Well not quite, but you could get close to what you're looking for by using the Google Reverse Geocoder and the Google Places API
Google Reverse Geocoding
http://code.google.com/apis/maps/documentation/geocoding/#ReverseGeocoding
If you send the service a geocode it will send back an address type and/or one of several adress components http://code.google.com/apis/maps/documentation/geocoding/#Types
Google Places API
http://code.google.com/apis/maps/documentation/places/
You could use the Google places API to search for for what's near. If the geocode is in the middle of the lake, the Places API may return something like "Lake Michigan" and then you'd know the terrain obviously.
All the methods and examples I can find about the Google maps api is based on a postcode, or coordinates to get the desired location - what if I want to place a marker for a specific business which has been added to google maps, so it shows tel number etc like an embeded map would? Even if I use exact coordinates for the address it doesn't recognise it. Sure I'm missing something really simple here...
Thanks!
The Google Places API, this does what your looking for. I couldn't tell you how to implement as of now because i am trying to put it inside of my Rails application but i will update my answer in the future when i do get it working though.