From nephish at gmail.com Sat Sep 13 10:43:05 2008 From: nephish at gmail.com (shawn bright) Date: Sat, 13 Sep 2008 14:43:05 +0000 Subject: [Ym4r-user] how to find a position Message-ID: <384c93600809130743k180fe2eayeffa21ba77ed94fe@mail.gmail.com> Hey there all, I am wanting my users to be able to log back into our site, and when they go to the map, i need it to remember the last position they were at and load that. How can i have the ym4r get the center and zoom of a client? shawn -------------- next part -------------- An HTML attachment was scrubbed... URL: From adam.jack at gmail.com Sat Sep 13 11:26:41 2008 From: adam.jack at gmail.com (Adam Jack) Date: Sat, 13 Sep 2008 09:26:41 -0600 Subject: [Ym4r-user] how to find a position In-Reply-To: <384c93600809130743k180fe2eayeffa21ba77ed94fe@mail.gmail.com> References: <384c93600809130743k180fe2eayeffa21ba77ed94fe@mail.gmail.com> Message-ID: What I've been doing (on more of an "edit this location" page) is adding event handlers that monitor drag/zoom changes and stash the values into form fields and allowing them to save. No reason you cannot send the value back up to the server via AJAX though. Not sure if you need to detect the movement of a marker or the map though. map.event_init marker, :dragend, "function(){ var latlng = marker.getPoint(); document.getElementById('location_lat').value = latlng.lat(); document.getElementById('location_lng').value = latlng.lng(); document.getElementById('location_manually_placed').checked = true;" + (update_message ? "document.getElementById('message').innerText = 'Press UPDATE to save this relocation.'}" : ""); map.event_init map, :zoomend, "function(o,n){ document.getElementById('location_zoom').value = n;" + (update_message ? "document.getElementById('message').innerText = 'Press UPDATE to save this zoom change.' }" : ""); regards, Adam -- Adam Jack adam.jack at gmail.com http://wildobs.com/adam_jack http://neukadye.com On Sep 13, 2008, at 8:43 AM, shawn bright wrote: > Hey there all, > I am wanting my users to be able to log back into our site, and when > they go to the map, i need it to remember the last position they > were at and load that. > How can i have the ym4r get the center and zoom of a client? > > shawn > _______________________________________________ > Ym4r-user mailing list > Ym4r-user at rubyforge.org > http://rubyforge.org/mailman/listinfo/ym4r-user From nephish at gmail.com Sat Sep 13 11:44:52 2008 From: nephish at gmail.com (shawn bright) Date: Sat, 13 Sep 2008 15:44:52 +0000 Subject: [Ym4r-user] how to find a position In-Reply-To: References: <384c93600809130743k180fe2eayeffa21ba77ed94fe@mail.gmail.com> Message-ID: <384c93600809130844k703c9a40w5693bd844e216478@mail.gmail.com> thanks, will see what i can work out with this. -sk On Sat, Sep 13, 2008 at 3:26 PM, Adam Jack wrote: > What I've been doing (on more of an "edit this location" page) is adding > event handlers that monitor drag/zoom changes and stash the values into form > fields and allowing them to save. No reason you cannot send the value back > up to the server via AJAX though. Not sure if you need to detect the > movement of a marker or the map though. > > map.event_init marker, :dragend, "function(){ > var latlng = marker.getPoint(); > document.getElementById('location_lat').value = latlng.lat(); > document.getElementById('location_lng').value = latlng.lng(); > document.getElementById('location_manually_placed').checked = true;" + > (update_message ? > "document.getElementById('message').innerText = 'Press UPDATE to > save this relocation.'}" : > ""); > > map.event_init map, :zoomend, "function(o,n){ > document.getElementById('location_zoom').value = n;" + > (update_message ? > "document.getElementById('message').innerText = 'Press UPDATE to > save this zoom change.' }" : > ""); > > regards, > > Adam > -- > Adam Jack > adam.jack at gmail.com > http://wildobs.com/adam_jack > http://neukadye.com > > > On Sep 13, 2008, at 8:43 AM, shawn bright wrote: > > Hey there all, >> I am wanting my users to be able to log back into our site, and when they >> go to the map, i need it to remember the last position they were at and load >> that. >> How can i have the ym4r get the center and zoom of a client? >> >> shawn >> _______________________________________________ >> Ym4r-user mailing list >> Ym4r-user at rubyforge.org >> http://rubyforge.org/mailman/listinfo/ym4r-user >> > > > > -------------- next part -------------- An HTML attachment was scrubbed... URL: