[OpenLayers-Users] Problem with zoomexents and google
maps la yer
John Cole
john.cole at uai.com
Mon Jul 16 15:39:32 EDT 2007
It is my experience that when you zoom to a bounding box, you should be able
to see the entirety of whatever is in the bounding box :-) For example, if
you zoom to either California or Tennessee, you should see the entire state,
which is what happens on our site.
Plugging Steve's values into a postgis query just to make sure the contains
was sane:
select Contains(makebox2d(makepoint(-89.47265625, 39.9476478239225),
makepoint(-83.968505859375, 42.06968462804663)),
makebox2d(makepoint(-87.79053, 39.89316), makepoint(-85.65279,
42.13795)))
shows that the OL viewport extent overlaps the requested extent, instead of
containing it. Using a standard WMS layer instead of the google layer,
Stephen's test returns true, so I suspect that the issue is only in the
google layer.
Here is the query for a WMS layer:
select Contains(makebox2d(makepoint(-89.4737351953125, 39.609305),
makepoint(-83.9695848046875, 42.421805)),
makebox2d(makepoint(-87.79053, 39.89316), makepoint(-85.65279,
42.13795)))
Which is true.
John
-----Original Message-----
From: users-bounces at openlayers.org [mailto:users-bounces at openlayers.org] On
Behalf Of Stephen Woodbridge
Sent: Monday, July 16, 2007 1:32 PM
To: Bill Woodall
Cc: Les Szklanny; openlayers user list
Subject: Re: [OpenLayers-Users] Problem with zoomexents and google maps
layer
Bill,
Maybe I'm missing something here, but it seems to me that if the
viewport width is defined by whatever means, and I make an ajax call
which returns stuff I want to display and the bounds of stuff, that
calling map.zoomExtents(boundsOfStuff) should zoom the map to an extents
or scale that will include all my stuff.
Also there is no reason to expect boundsOfStuff to be the same aspect
ratio of the viewport. I think zoomExtents tries to compute a new
extents based on the correct aspect ratio and to zoom it to the best
scale the will show the extents.
This in facts works fine with mapserver and we have never seen a
problem, but with google we occasionally run into this problem. The
example Les put together is just one case that reproduces the problem
for debugging purposes.
Thanks,
-Steve
Bill Woodall wrote:
> Hi Steve,
>
> After looking at your example I noticed that you are using CSS
> (width:100%) for your map div and thus the browser will set the viewport
> width and the viewport might never equal the bounds you set.
>
> ......Bill,
>
> On Mon, 2007-07-16 at 10:43 -0400, Stephen Woodbridge wrote:
>> Chris,
>>
>> Attached is an html test case. You will probably need to set the google
>> key to your host. This was run using OL 2.4. Sorry for the file instead
>> of a URL, I didn't have a host with a google key that was publically
>> accessible and readily accessible to me to post the example.
>>
>> Les also tried John Cole's suggestion, but that did not solve the
>> problem either.
>>
>> -Steve
>>
>> Christopher Schmidt wrote:
>>> On Fri, Jul 13, 2007 at 05:43:42PM -0400, Stephen Woodbridge wrote:
>>>> Hi all,
>>>>
>>>> I have run into an annoying issue that if you zoom to an extents the
>>>> extents is not always inside the viewport, so if I have a bunch of
>>>> points and zoom to their extents, sometimes some of the points are
>>>> outside the viewport after the zoom.
>>>>
>>>> Is there a fix or workaround for this problem?
>>> Can you provide a test case for this?
>>>
>>> Regards,
>> HTML page attachment (google-ol-bug.html)
>> OpenLayers With Google Layer Example
>> _______________________________________________
>> Users mailing list
>> Users at openlayers.org
>> http://openlayers.org/mailman/listinfo/users
>
_______________________________________________
Users mailing list
Users at openlayers.org
http://openlayers.org/mailman/listinfo/users
This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the sender. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
More information about the Users
mailing list