Google Groups Home
Help | Sign in
get point on current map
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  5 messages - Collapse all
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
dms  
View profile
(1 user)  More options May 11, 10:20 am
From: dms <diegui...@gmail.com>
Date: Sun, 11 May 2008 07:20:48 -0700 (PDT)
Local: Sun, May 11 2008 10:20 am
Subject: get point on current map
hi there!
how can i get the center lat & lng.
it is possible to recalculate the center when i move the map?
thx!

    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
f5vag  
View profile
 More options May 11, 10:46 am
From: f5vag <f5vag...@gmail.com>
Date: Sun, 11 May 2008 07:46:31 -0700 (PDT)
Local: Sun, May 11 2008 10:46 am
Subject: Re: get point on current map
On May 11, 4:20 pm, dms <diegui...@gmail.com> wrote:

> hi there!
> how can i get the center lat & lng.
> it is possible to recalculate the center when i move the map?
> thx!

Yes.
You could try to take a look at the docs:
http://code.google.com/apis/maps/documentation/reference.html

GE


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dms  
View profile
(1 user)  More options May 11, 11:35 am
From: dms <diegui...@gmail.com>
Date: Sun, 11 May 2008 08:35:40 -0700 (PDT)
Local: Sun, May 11 2008 11:35 am
Subject: Re: get point on current map
i am asking my questions in bad way or what happens?
please let me know if i can change anything to get better answers

On 11 mayo, 11:46, f5vag <f5vag...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Martin  
View profile
(1 user)  More options May 11, 12:31 pm
From: Martin <warwo...@gmail.com>
Date: Sun, 11 May 2008 09:31:29 -0700 (PDT)
Local: Sun, May 11 2008 12:31 pm
Subject: Re: get point on current map
Use the GMap2 method getCenter() to get the current center of your map
as a GLatLng type.

var c=myMap.getCenter();
var lat=c.lat();
var lng=c.lng();

To detect map movement listen for the 'moveend' event:

GEvent.addListener(myMap, 'moveened', function() {
  // map has moved so get new center

});

That's assuming your map variable is myMap!

Martin.

http://code.google.com/apis/maps/documentation/reference.html#GMap2
http://code.google.com/apis/maps/documentation/reference.html#GLatLng
http://code.google.com/apis/maps/documentation/reference.html#GEvent

On 11 May, 16:35, dms <diegui...@gmail.com> wrote:


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
dms  
View profile
 More options May 11, 1:05 pm
From: dms <diegui...@gmail.com>
Date: Sun, 11 May 2008 10:05:17 -0700 (PDT)
Local: Sun, May 11 2008 1:05 pm
Subject: Re: get point on current map
Thankyou martin solved with

GEvent.addListener(map, "moveend", function() {
    mapCenter = map.getCenter();


    Reply to author    Forward  
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2008 Google