Try:
google.maps.event.addListener(map, 'click', function(evt) {
var marker = new google.maps.Marker({
position: evt.latLng,
map: map,
title: 'Event',
draggable: true
});
Chad Killingsworth
On Jun 7, 9:55 am, Allan <[email protected]> wrote:
> var latlng = new google.maps.LatLng(5,5);
> google.maps.event.addListener(map, 'click', function() {
> var marker = new google.maps.Marker({
> position: latlng,
> map: map,
> title: 'Event',
> draggable: true
>
> });
>
> I can create a marker when i click on the map like this.
> I can also use position: map.getCenter()
>
> What I want is for a SINGLE marker to be created wherever i click.
>
> This was really simple in v2.
>
> Can anyone help?
--
You received this message because you are subscribed to the Google Groups
"Google Maps JavaScript API v3" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/google-maps-js-api-v3?hl=en.