add a marker
it would be nice if you provide a simple solution to add a marker (pin)
-
AdminAdam Krogh (Admin, SnazzyMaps) commented
Hi Josh,
If you have downloaded the "simple example", open the .html file in notepad or a similar text editor. On line 39 of the file you'll see the following:
center: new google.maps.LatLng(40.6700, -73.9400), // New York
This line of code tells the map where to center the map. A little further down you'll see where we add the marker. Around line 54 you'll see this:
var marker = new google.maps.Marker({
position: new google.maps.LatLng(40.6700, -73.9400),
map: map,
title: 'Snazzy!'
});The `position` property above tells Google where to place the marker on the map. Changing the latitude and longitude on the above marker position and map center should give you what you are looking for.
Let me know if this makes sense or if you have any other questions.
-
Josh commented
I know that you guys added it to the 'simple example' but I cannot find where it is - when I download the example style, it opens in my browser as a map with a pin in Brooklyn. There's no way to understand what I need to do.
REALLY would love any help on this, I've been bashing my head against the monitor for about 3 hours now. I can't believe it's truly this difficult, I must be missing something
-
AdminAdam Krogh (Admin, SnazzyMaps) commented
Hi Rob,
As part of our simple downloadable example we've added a bit of code to show a marker. Hopefully this helps people out a little bit.
We've also released a huge update to the site this week. Check it out at https://snazzymaps.com
-
Nauris commented
Yes, please .. How?