[OSM-dev] LeafletJS strange behaviour with OSM layer
Yohan Boniface
yohanboniface at free.fr
Fri Sep 6 22:09:44 UTC 2013
Sounds like the container of your map has changed after its initialization.
Try calling map.invalidateSize() when the container has its definitive size.
Yohan
On 09/06/2013 08:51 PM, François Lacombe wrote:
> Hi,
>
> I'm currently trying to switch to OSM (from Google Maps) on several
> pages & apps of my website.
>
> All is working fine with leafletJS but some of my apps doesn't get all
> tiles loaded.
> You can find an example here :
> http://www.infos-reseaux.com/apps/ADSLObs/carte-nra-nro/?domain_id=FT
>
> Only one row of tiles is loaded at the top of my map frame and I need to
> drag down it to see other tiles on my screen.
>
> The div where leaflet is build received this css :
> .app-webVRD-gMapsContainer {
> background-color:#FFFFFF;
> height:600px;
> min-height:600px;
> width:100%;
> min-width:100%;
> }
>
> Here is the leaflet init JS :
> // Conteneur
> _MAP = L.map(gmaps_container_id, {
> "doubleClickZoom":false,
> "scrollWheelZoom":true
> });
>
> // Couche OSM
> L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png
> <http://tile.openstreetmap.org/{z}/{x}/{y}.png>', {
> attribution: 'Map data © OpenStreetMap contributors',
> maxZoom: 18,
> minZoom:1
> }).addTo(_MAP);
>
> I'm working on firefox 23.0.1, I get the same on Chrome and IE.
>
> Thank you in advance for any tip about this problem.
>
>
> Cheers.
>
>
> *François Lacombe*
>
> francois dot lacombe At telecom-bretagne dot eu
> http://www.infos-reseaux.com
>
>
> _______________________________________________
> dev mailing list
> dev at openstreetmap.org
> http://lists.openstreetmap.org/listinfo/dev
>
More information about the dev
mailing list