[OpenLayers-Dev] Bug in OpenLayers Bing support for data attribution

Eric Blasenheim eric.blasenheim at pb.com
Mon Apr 9 10:25:43 EDT 2012


I am brand new to this list and the site so I was hoping for some suggestions in getting a bug in the Bing Maps data Attribution checked in.

The bug that I found was that when your entire map is west of -90 or east of +90,  no text attribution shows up. I have attached a picture but this is easily reproducible at http://openlayers.org/dev/examples/bing-tiles.html .  (It's also probably not a good idea to leave out attribution when you view the providers home location of Seattle.)

The fix seems to be a very simple change that forces the code to handle the fact that the JSON response from the Imagery Metadata call for the bounding boxes is lat/lon and not Lon/lat.
For example:
bbox=27, -179.99, 87, -126.5  is clearly two lat/lon rather than lon/lat pairs.

I discovered that the existing code was not passing the "reverseOrder" flag to "OpenLayers.Bounds.fromArray".  Just adding missing second parameter of "true" allows the code to generate bounding boxes consistent with the rest of Open Layers and the bug is fixed.  The line below with the added parameter is from Bing.js.

bbox = OpenLayers.Bounds.fromArray(coverage.bbox, true);

Normally, I do not like hard coding "true" or any constants if there is a different way but in this case, I see no way expressing that the JSON data order returned from the Microsoft call  is what it is.

Of course, this also means that the attribution was not correct in many places even when it did show up.

As I am not familiar with the processes used for validation or testing but I hope I will hear from someone soon.

Thanks in advance,
Eric Blasenheim

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/openlayers-dev/attachments/20120409/c8903661/attachment.html


More information about the Dev mailing list