CloudMade/Leaflet — Issue #469: Incorrect rendering of image layer when NE LatLng goes over 180
Author: peskyneil
Created: 2012-02-06 00:50:23+00:00
State: open

I'm trying to add an image layer taken from the Australian BOM. I have the bounds of the image layer set as follows

> var imgBounds = new L.LatLngBounds(new L.LatLng(17.312500, 64.812500), new L.LatLng(-65.411937, 184.812000));

imgBounds is then used when creating the overlay which is then added to the map. I was anticipating that this would place the layer above Australia with the NE corner going over the 180 line and effectively wrapping back round to -4.

What actually happens is that the overlay gets stretched out to cover everything but the area defined. So you get the overlay being the correct height, but stretching from -4 across South America, South Africa and finishing on the SW coordinate.

If I change the NE coordinate to be 179.99 instead of 184.812 then the overlay is placed correctly, but is slightly compressed due to the reduction in width the overlay gets.

According to the javascript I'm using version 0.2 of the leaflet library.

Is there a way to have the overlay wrap correctly under this sort of a scenario?