On 20 Apr, 23:36, "[email protected]" <[email protected]> wrote:
> On Apr 20, 2:14 pm,nimrod<[email protected]> wrote:
>
>
>
>
>
> > On 20 Apr, 22:25, Esa <[email protected]> wrote:
>
> > > You did not even try a draggable marker.
>
> > >http://code.google.com/apis/maps/documentation/reference.html#GMarker
>
> > Thank you both for your directions and help!
>
> > Ok, I'm new to this world... this is the code from the code-
> > playground. How should I incorporate that? Should I put it in the
> > function place?
>
> > I appriciate any advice! :-)
>
> > /Nimrod
>
> > Draggable marker:
> > ---
> > var map = new GMap2(document.getElementById("map_canvas"));
> > var center = new GLatLng(37.4419, -122.1419);
> > map.setCenter(center, 13);
>
> This is the line that makes a GMarker and makes it draggable:
>
>
>
>
>
> > var marker = new GMarker(center, {draggable: true});
>
> > GEvent.addListener(marker, "dragstart", function() {
> > map.closeInfoWindow();
> > });
>
> > GEvent.addListener(marker, "dragend", function() {
> > marker.openInfoWindowHtml("Just bouncing along...");
> > });
>
> > map.addOverlay(marker);
> > ----
>
> > function place(lat,lng) {
> > var point = new GLatLng(lat,lng);
> > map.setCenter(point,14);
>
> This line doesn't make the marker draggable...
>
>
>
> > map.addOverlay(new GMarker(point));
> > document.getElementById("message").innerHTML = "";
> > }- Dölj citerad text -
>
> - Visa citerad text -- Dölj citerad text -
>
> - Visa citerad text -- Dölj citerad text -
>
> - Visa citerad text -
OK, thanks...so I should use:
> map.addOverlay(new GMarker(point));
> document.getElementById("message").innerHTML = "";
> }
And where should I implement it?
Looking in the function below I have it: function place(lat,lng)
{
var point = new GLatLng(lat,lng);
map.setCenter(point,14);
map.addOverlay(new GMarker(point));
document.getElementById("message").innerHTML = "";
}
Should it be;
map.addOverlay(new GMarker(point) center, {draggable: true});
I have tried this but and the map is displayed but not the
marker...why is that?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Maps API" 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-API?hl=en
-~----------~----~----~----~------~----~------~--~---