it works all fine and even give me the lat/long when i drag it to any place,
but how can i get the address from that lat/long? plz help me.....
function fix6ToString(n) {
return n.toFixed(6).toString();
}
Drupal.gmap.factory.marker = function(loc,opts) {
opts['draggable'] = true;
return new GMarker(loc,opts);
}
Drupal.gmap.addHandler('gmap', function(elem) {
var obj = this;
obj.bind('init',function() {
if (obj.vars.behavior.autozoom) {
obj.bounds = new GLatLngBounds(new
GLatLng(obj.vars.latitude,obj.vars.longitude),new
GLatLng(obj.vars.latitude,obj.vars.longitude));
}
});
obj.bind('addmarker',function(marker) {
var m = Drupal.gmap.factory.marker(new
GLatLng(marker.latitude,marker.longitude),marker.opts);
marker.marker = m;
GEvent.addListener(m,'click',function() {
var point = m.getPoint();
m.openInfoWindowHtml( fix6ToString(point.lat()) + " , "
+fix6ToString(point.lng()));
});
GEvent.addListener(m, "dragstart", function() {
obj.map.closeInfoWindow();
});
GEvent.addListener(m, "dragend", function() {
});
On Wed, May 6, 2009 at 3:41 PM, nimrod <[email protected]>wrote:
>
> Hi,
>
> thanks...should the getAddress-function only take the latlng-
> parametrer?
> getAddress(latlng) {
>
> So, in that case i send the latlng into geAddress and then provide the
> response to showadressnew-function?
>
> /nimrod
>
> On 6 Maj, 09:40, Rossko <[email protected]> wrote:
> > > Question: Should I use GEvent.addListener(marker, "dragend",
> > > getAddress ) so that the function getAddress is called when the marker
> > > not is dragged anymore?
> >
> > Yes ... but ..
> >
> > > function getAddress(overlay, latlng) {
> >
> > Referring to Mike's handy reference to GMaps API Events
> > http://econym.org.uk/gmap/gevent.htm
> > a 'dragend' event on marker supplies only one parameter which is a
> > Glatlng.
> > You need to alter your getAddress() to deal with that, it currently
> > tries to use a second parameter which doesn't exist.
> >
>
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---