• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to put a pin in a google maps location

 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

This seems like such an obvious question that I feel I should preface by promising everyone that I really did try to google for the answer...

I was going through the google maps API tutorial (the javascript one)

http://code.google.com/apis/maps/documentation/javascript/tutorial.html

The example was very simple to use... all you have to do is pass in some coordinates and bingo, you have a map (I'm not going to repost the code here, it's in the "Hello World" example).

Here's my problem - the map centers on the coordinates, but there's no "pin" on the coordinates like you usually get with google maps. I searched around, and I couldn't find any documentation on how to add a pin... it seems like the sort of thing that would be a simple property in the map options

).

If anyone has managed to do this, please let me know! Thanks.
 
Marshal
Posts: 28193
95
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I've done that. The code I used is at home so I can't quote it here, but I'm sure I learned how to do it from one of the tutorials. You've found them, haven't you? Displaying a pin was in one of the very first examples if I recall right (it was a few years ago).

Edit: I did my 30 seconds of googling and found a tutorial: Creating Your First Map. It's in there.
 
Jeff Ballie
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Paul - that helped. I read the tutorial, and it looks like these are called markers rather than pins, which probably explains why my googling was so unsuccessful.. anyway, once I searched on maker, I turned up a tutorial for V3 of maps pretty quickly.

http://www.svennerberg.com/2009/07/google-maps-api-3-markers/

Just in case anyone else is following this thread and wants to know how it worked...



The only difference between this and the hello world sample on the Google Maps tutorial link is that the addition of the var marker stuff (also, I changed the zoom and pointed the map at sproul plaza in berkeley)...
 
Sheriff
Posts: 67746
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When using BB Code tags, be sure to use them correctly. I fixed your post for you.
 
reply
    Bookmark Topic Watch Topic
  • New Topic