Thank you Marcelo

that certainly helped me a little further - while this is working the
first-time when I click on the marker, it fails the following times.


this is what I do when I click on a marker - move the map with the
marker to the NW location with an offset of 50px;
before moving the map, I save the position.

then I get the marker position like this: var pos =
this.map.fromLatLngToDivPixel(marker.getLatLng());
the first-time it returns 50 for x and y. the click also opens then a
custom info window - that works fine the first-time as well.

closing the info-window restores the map to its previous location.

clicking on the marker again, this var pos =
this.map.fromLatLngToDivPixel(marker.getLatLng()); now returns some
weird negative values and I have no idea why?!

Any ideas - Am I missing something here?



On Nov 16, 6:51 am, marcelo <[EMAIL PROTECTED]> wrote:
> You can write a setNW() function like I described 
> here:http://groups.google.com/group/Google-Maps-API/browse_thread/thread/b...
>
> and then, in the marker's click event handler do something like
>
> map.setNW(marker.getLatLng());
>
> --
> Marcelo -http://maps.forum.nu
> --
>
> On Nov 15, 5:14 pm, mmjaeger <[EMAIL PROTECTED]> wrote:
>
> > do you know whether there is an example somewhere - I really have
> > problems to get started and get the values from the map and the marker
> > I need.
>
> > On Nov 15, 5:03 pm, donb <[EMAIL PROTECTED]> wrote:
>
> > > add or subtract them, depending on which quadrant of the globe it's in
> > > (whether it's + or - lat,  + or - lon)
>
> > > On Nov 15, 10:05 am, mmjaeger <[EMAIL PROTECTED]> wrote:
>
> > > > Thanks for your input - how would I calculate the lat lon offset then
> > > > between the edges and the marker?
>
> > > > On Nov 15, 3:51 pm, donb <[EMAIL PROTECTED]> wrote:
>
> > > > > The Gbounds() object tells you the dimensions of the visible map area,
> > > > > so you need to calculate the lat lon offset between the edges and the
> > > > > marker, then re-center the map to position the marker where you need
> > > > > it - all from within the click event of the marker.  Of course, if the
> > > > > 'click' also opens an infowindow that's going to potentially move the
> > > > > map again.
>
> > > > > On Nov 15, 9:41 am, mmjaeger <[EMAIL PROTECTED]> wrote:
>
> > > > > > Hello
> > > > > > when I click on a marker, I like the map moved so the clicked marker
> > > > > > would appear in e.g. the upper-left of the map canvas - hope 
> > > > > > somebody
> > > > > > has an idea how this could be done.
>
> > > > > > thank you in advance for your help.- Hide quoted text -
>
> > > > - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to