Place markers through search in Google maps API (static) - google-maps

I am currently working with the Google Maps API and returning static maps (images) from the API.
I need to place markers on the map. The documentation says how to place markers on the map by defining long/lat values: http://code.google.com/apis/maps/documentation/staticmaps/#Markers
My problem is that i donĀ“t know where to place the markers. I want a google maps search phrase to determine the placement of the markers. Is that possible?
To sum up:
I want to submit a search phrase to the API and have a static map (image) returned with markers matching my search phrase.

You can place markers based on an address:
http://maps.google.com/maps/api/staticmap?center=55.665149742004,12.5627200816055&zoom=12&size=640x640&sensor=false&maptype=hybrid&markers=color:blue|label:S|smallegade%201,%20frederiksberg

Yes, it's possible. Try this:
http://code.google.com/intl/pl/apis/maps/documentation/geocoding/
This particular link regards to Maps API Web Services, but there are others api, for javascript for instance.
Generaly you need Geocoging that tranlate address to latitude and longitude

I believe you can not search a term in Maps Static version. It is not in the accepted parameters: https://developers.google.com/maps/documentation/maps-static/dev-guide#Usage
Try using Embed or JavaScript versions instead.

Related

Google Maps Places API, need to get same markers as on Google emded

Good day !
I'm developing custom service, that will grab params form Google Maps url, like https://www.google.nl/maps/search/fietsenmaker/#52.1285737,5.0837216,13z/data=!3m1!4b1?hl=en. From this example it's possible to take search param, longitude, latitude and zoom level. All this params will pass to Google Places API and markers will be drawn on Google map. The main problem, i can't get this markers look same as on embed Google Maps. Here is attachment:
In simple words:
Need to dynamically embed map with listing of places, that was originally in search param and place map center according lat/long with original markers as on embed map.
Any ideas ?
Thanks !
Google Embed API will allow you to embed maps with starting params, like map center, object name. You can find it here https://developers.google.com/maps/documentation/embed/guide
Good luck everybody !

Google maps embed API fallback coordinates

I have a website that contains a database of places, mostly stores and small businesses, and i want to add a google map for every business on the site. I have a name and coordinates for each business, but not all of them are listed on google maps. If i make a Google Maps Embed API map like this:
https://www.google.com/maps/embed/v1/place?key=APIKEY&q=Place name
I will get a marker on that place, but if that place is not found, is it possible to make it put a marker on the coordinates provided?
I know i can just use the coordinates without any name, but in case the place is listed on google maps, querying its name instead of coordinates will display details about the place
Yes you can still place a marker as long as you have the lat and long.
You can add your business to Google Map over here.

How to retrieve a static map showing city or municipality boundaries

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

google maps link

I want to place a link on my website that links to google maps,
however I can't find information on how to form the url.
I have lat and lng coordinates and I want a marker to show the exact point.
I have this for example
http://maps.google.co.uk/maps?hl=en&ll=55.236865,-1.616422&z=15
but it shows no marker
This can be done even easier now: https://google.com/maps/place/55.236861,-1.616417
http://maps.google.com/maps?f=q&hl=en&q=Via+Celadina,+4,+24125+Bergamo+Bergamo,+Lombardy,+Italy&sll=6.315299,14.414063&sspn=123.405342,329.0625&ie=UTF8&cd=1&geocode=0,45.688764,9.709610&ll=45.689094,9.709618&spn=0.00676,0.020084&t=h&z=16&iwloc=addr
And also
http://asnsblues.blogspot.com/2011/11/google-maps-query-string-parameters.html/
Stack:
Google maps URL. I want to create a URL to google maps. I want to show search near specific coordonates
all the googlemap api are define here
http://maps.google.co.uk/maps?hl=en&ll=55.236865,-1.616422&z=15&q=#55.236865,-1.616422

Search a google map I have created and embedded into my website

I have a Google map I have created to highlight the location of several support groups by adding my own pins using my maps and embedding this into my website.
Is there a Google widget of any description to allows people to search my custom map and find their nearest support group (or nearest pin).
I have read through the Google maps stuff but cant seem to find anything that meets my requirements.
Any help appreciated.
The map has no clue about which markers or overlays you have put on it. Therefore there are no way you can do what you want using Google Maps directly. You can however do something else.
When you create your markers/overlays and place them on the map you can add them to an array. When you users then enters a location you can search through that array to find the markers that are closest to the location the user has entered. Google Maps API has a method for getting the distance between two latlngs, but you can also use an ordinary Haversine formula for calculating it.
Once you have found the closest markers it is not hard making sure they are the only ones that are shown on the map.