I need to get a static image of the route/path (polyline) in a map.
I'm reading the Google Maps Static API docs here:
https://developers.google.com/maps/documentation/maps-static/intro
But I can't find the option to request the API to get the path only, without the map in the background, the map needs to be transparent.
You can use the PATH parameter of Maps Static API.
Here is a sample request:
https://maps.googleapis.com/maps/api/staticmap?center=Empire%20State%20Building&zoom=13&size=400x400&path=color:0xff0000ff|weight:5|40.737102,-73.990318|40.749825,-73.987963|40.752946,-73.987384|40.755823,-73.986397&key=YOUR_API_KEY
Hope this is the one you are looking for!
Related
I want to use the google maps javascript API for my project. I am using directions API to show path between two places on the map. My problem is since this app is focusing on a very rural area all the paths in the area still not in the google maps. Can I include those new paths to my instance of google maps and use the directions API to navigate through the paths? How can I do this? Is there a way to add a path to map as a polyline and use it for directions?
Update:
here is a screenshot of the application I was developing.
The white color path, works with directions api. I draw a polygon with coordinates I know of the unknown path, I want to use that path with directions api to show directions.
I need to redirect from a static google maps image via the Static Maps API to maps.google.com.
I have multiple markers on the map. Example: "http://maps.googleapis.com/maps/api/staticmap?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862"
I need the proper url format that, when the image is clicked, will redirect to maps.google.com with all markers placed on the map. I cant find the documentation on how to do this.
There are no way to add markers into the google maps now.. so the answer is no.
However, you can build a custom page, which uses the google maps API and you can add markers that way.
I built a sample page here in github.
so for your map:
you can wrap it with an a element which link to your page with the same option like this sample:
http://kylelam.github.io/SO/customMarkers.html?size=235x227&maptype=roadmap&markers=37.970982,23.724559|37.971487,23.724953|37.973291,23.726862
I would like to draw a circle as an overlay on the given google maps url. This is without using the google maps API. Hence, i would like to know if this can be achieved bu just passing certain parameters to the maps url.
The url i'm using is
https://maps.google.com/maps?saddr=M5J&sensor=false&output=embed
Thanks in advance.
No, unfortunately this cannot be done using URL parameters, you have to use the Google Maps API. Here is a list of available URL parameters.
I'm not sure where to start looking in the documentation, but I'm trying to load map images of cities with their boundaries outlined.
Like this...
Any help getting started would be greatly appreciated, I'm pretty new to the maps api.
Thanks
There is currently no way to request a map with boundaries automatically rendered on it. Your best bet is to pull the polygon information from another system and render using an encoded polyline if you're using the Static Map API or regular overlays in the JavaScript API.
Google Static Map API
Here it is
here, some links to help you:
Geographical boundaries of states/provinces -> Google Maps Polygon
EInsert extension
Boundary Draw - Google Map Application
Getting neighbourhood boundaries from Google Maps API
https://stackoverflow.com/questions/8441467/can-you-draw-custom-search-boundaries-in-google-map
Ability to draw boundaries on Google Maps
Usually u have to set up a little script + htmlpage on your server to run google maps,
but i was wondering - is it possible to use google maps directly?
i mean by just calling an url with parameters (gpoint coordinates, zoomfactor ..) and it loads the map fullscreen without having to use my own server?
Sounds like you might be after the static maps api. You can build a URL specifying the properties of the map like:
zoom
position
markers (including custom markers)
image size
etc
and you will get back a rendered image of the map. Something like:
Obviously this just gives you a fixed image of the map you are after. If you need a dynamic Google map, then you will need to use the Google Maps Javascript API.
Not hosted by Google. You might find some other website that uses the API to do the same thing.
Google Maps API