leaflet in wordpress

40 views
Skip to first unread message

patrice pellier

unread,
Feb 15, 2016, 3:11:48 PM2/15/16
to Leaflet
I open a page with a leaflet in a clear wordpress theme and I get this :
Like if the tiles had been shuffeld :



here is my javascript code (simplified) :

   var tuileUrl = 'http://{s}.tile.osm.org/{z}/{x}/{y}.png';      

    var attrib='Map data © <a href="http://openstreetmap.org">OpenStreetMap</a> contributors';
    var map = L.map('map').setView([49,2,0],  16);
    var osm = L.tileLayer(tuileUrl, {
        minZoom: 16, 
        maxZoom: 17,
        attribution: attrib
    });
    osm.addTo(map);..


(I cannot use the leaflet plugin cause I need full and dynamics options on the map)


Does somebody understand what's happening ?

Thank's per advance 

and sorry about my english


Chris Hill

unread,
Feb 15, 2016, 3:23:20 PM2/15/16
to leafl...@googlegroups.com
On 15/02/16 20:11, patrice pellier wrote:
> I open a page with a leaflet in a *clear* wordpress theme and I get
> this :
> Like if the tiles had been shuffeld :
>
> <https://lh3.googleusercontent.com/-O6mO3nrtep0/VsIwbS9KPjI/AAAAAAAACEA/RcEuStlNMCs/s1600/cap.png>
>
>
>
> here is my javascript code (simplified) :
>
> |
> vartuileUrl ='http://{s}.tile.osm.org/{z}/{x}/{y}.png';
> |
> |
> var attrib='Map data © <a
> href="http://openstreetmap.org">OpenStreetMap</a> contributors';
> var map = L.map('map').setView([49,2,0], 16);
> var osm = L.tileLayer(tuileUrl, {
> minZoom: 16,
> maxZoom: 17,
> attribution: attrib
> });
> osm.addTo(map);..
> |
>
>
> (I cannot use the leaflet plugin cause I need full and dynamics
> options on the map)
>
>
> Does somebody understand what's happening ?
>
>
Looks like you are not including the CSS that Leaflet needs.

--
Cheers, Chris (chillly)

patrice pellier

unread,
Feb 15, 2016, 3:33:46 PM2/15/16
to Leaflet
Very thanks,

(I fell a bit stupid)

patrice pellier

unread,
Feb 15, 2016, 3:34:05 PM2/15/16
to Leaflet
*feel*


Le lundi 15 février 2016 21:11:48 UTC+1, patrice pellier a écrit :

Rex

unread,
Feb 5, 2017, 12:54:05 AM2/5/17
to Leaflet
Hi Patrice,

Would you mind to share how did you make the leaflet map working with wordpress?

Any blog post for the tech details?

Thanks,
Rex
Reply all
Reply to author
Forward
0 new messages