How can i generate Walking or Driving static google map - google-maps

I am trying to create a google map using the static google map API. I want walking and driving static map.
Bellow is the path i am using :
http://maps.google.com/maps/api/staticmap?maptype=roadmap&zoom=14&size=400x250&markers=color:green|label:A|30.7261629,76.7596221&markers=color:red|label:B|30.7226447,76.7681678&path=color:0xff0000ff|weight:3|30.7261629,76.7596221|30.7226447,76.7681678&sensor=false

Static map api support only marker not direction.
If you want to use direction with Static map, you need to use direction api.
How to do: how to create a static api map with directions
Basically what the up-voted answer is saying:
1. Use direction api to get encoded path.
2. In static map use this encoded path.

Related

Link to Google maps with dynamic path

I want to link to Google Maps with a lat & long :
For that, I Used : http://maps.google.com/maps?q=48.819141912303,2.2297863639837
I'm wondering if I can add a Path to this Google Maps ?
I used it in a static map and Can I do that with this Google maps link ?
https://maps.googleapis.com/maps/api/staticmap?path=48.819141912303,2.2297863639837|48.81863290356,2.2312122798508|48.818734654467,2.2313515376389&scale=true&size=600x300&maptype=roadmap&format=png&visual_refresh=true
I don't think that this is possible to open a map with an arbitrary polyline on it. You should use APIs for this purpose.
However, you can open the map with driving directions that pass through specified waypoints.
Just create Maps URLs for directions with origin, destination and waypoints.
For example,
https://www.google.com/maps/dir/?api=1&origin=48.819141912303,2.2297863639837&waypoints=48.81863290356,2.2312122798508&destination=48.818734654467,2.2313515376389&travelmode=walking
Have a look at Maps URLs documentation for further details.

Google Maps to display only a country or state

What features of the Google Maps API would one use to display a single country or state, that is static, and has location markers?
When I am using Google Static Maps I use the website below. It makes creating these maps a whole lot easier.
Static Map Generator
http://staticmapmaker.com/
If you want to take the long route you can use the API. Also, it helps to use the generator and make further changes to the map by referencing the API. Despite what you read on the API you do not need an API key to generate the maps.
Google Static Maps API
https://developers.google.com/maps/documentation/imageapis/

Google Maps Api - newbie

I am starting to work on a Google Maps project, but I am totally new to Google Maps Api, as well as my JavaScript skills are quite small, my background is Java. I have started reading throught the docs and tutorials, but some basic questions stay unanswered, so I hope to get some help from you.
Does Google Maps api provide a way for user access control? Lets say, I have a map where my registered users(Joomla site) can add placemarks, how do I tell Google Maps if this user is allowed to work on the map? Or do I have to take care of that by myself without the Maps API?
What would be the right approach to create the following functionality: I want to let a user add a placemark to an empty map. Then I will check if the point added is ok for public publishing. If it's ok, then I want to transfer that placemark to the public map.
Is there some Maps API function to read out the placemarks on a specific map?
Andy
Regarding the user access control, it seems that I have mixed two things. When you use Google Maps on Google website, and you create your map with markers, you can specify other users who are allowed to add and edit markers on that map. However, Google Maps api obviously does not save a server side copy of the map you are working on. So everything happens at your site. If you add markers, then you have to keep track of them by yourself, so also user access control is your own problem.
However, I wonder, what would happen when I would create my own map on the Google Maps website with my own markers, and then I would display this map on my site. What would be then the way to read out the markers, lets say for a list of markers.
It seems that the right way is to implement it all yourself. Let user set marker, save the marker in database. Review the marker and if accepted mark it and display it on the public map when populating the map with your markers.
Ok, so I've been reading around and I found out, that obviously Google Maps does not provide a function to read out all markers on a map: how to get all markers on google-maps-v3

Google Static Map

I need to use Google Static Map api, but I need to give it from (latitude, longitude) to (latitude, longitude) and show maps between those two places
can anyone support in this part please
I'm using this code this get map of one place
http://maps.google.com/staticmap?center=30.0566,31.2262&format=png32&zoom=10&size=360x602
but I want to get the map between two places
from : 30.0566,31.2262
to : 25.6969,32.6422
Thanks in Advance
Google Static Maps does not support driving directions. However it does support drawing lines, including encoded polylines. Everything is subject to the maximum length of a URL (2048 characters).
This means you can use the Directions API server-side, extract the encoded polyline from the results and construct the Static Maps URL using the line.
Documentation for the Directions API

Using Google Static Maps with API v3 - need an updated reference please!

The guide Using Static Maps to Speed Up Your Dynamic Maps is painfully out of date.
Can you help show me what this should look like with API v3? I'm specifically interested in the tail end of the process, involving the callback, etc.
I've already got this figured out:
google.maps.event.addListenerOnce(map, 'tilesloaded', removeStaticMap);
EDIT:
Am I correct in that the proper initialization would be using this technique (with the loadScript)?
You shouldn't need a static map - the v3 API actually loads a static map first and then swaps it out when the tiles are loaded.