3

This is a topic I thought as easy as pie to solve with just a Google search and which is in fact quite complicated.

When I use the following URL string to open a GoogleMaps window on a specific location, I get 2 markers (one green on the exact position of the Lat/Lng coordinates I put in the URL, and one red which is the nearest address).

I would like to get just the green marker, which means opening a new GoogleMaps window with a marker matching the Lat/Lng coordinates from the URL. This is quite simple, but I can't find out on the web if it possible or not.

This is possible with OpenStreetMap using the following URL.

2

So, do you want the green icon? Or the position of this without the geocoded address?

To get just the real position you can trim your lat/lng to 6 decimal places.
Then you can use brackets (Marker) or anything inside the brackets

So you get:

46.907091,0.243929 (Real Position)

This is done by clicking the (to link) button. This only works with the older version of Google Maps not the revamped version.

The difference is the span of the map and the maximum zoom level.

  • Great Mapperz ! Thank you very much... That was exactly what I was looking for. – wiltomap Feb 10 '14 at 16:12
0

Check out the Google Maps Static API, specifically the section on markers.

Using the static maps API, I can create a URL with the marker setup you requested like so:

http://maps.googleapis.com/maps/api/staticmap?center=46.9070919481631,0.243929350189987&zoom=6&size=400x400&markers=color:green|size:mid|label:H|46.9070919481631,0.243929350189987&sensor=false

Which results in the following static map image:

enter image description here

Now.. the downside to this approach is that it gets you a truly static image, not an interactive Google Map. Hopefully that limitation doesn't impact your use-case.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.