Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter julien_daniel

    (@julien_daniel)

    Example of style that I would use :

    var LineStyle = {
    “color”: “#ff3010”,
    “dashArray”: “10,7”,
    “lineJoin”: “round”,
    “weight”: 5,
    “opacity”: 0.65
    };

    Plugin Author bozdoz

    (@bozdoz)

    Color, weight, and opacity are supported.

    [leaflet-geojson color="red" weight=5]

    Thread Starter julien_daniel

    (@julien_daniel)

    Voilà l’exemple d’utilisation sur un site, pour une carte de voyage en Atlantique :

    [leaflet-map lat=30 lng=-45 zoom=3]
    
    [leaflet-line color="DimGray" weight=3 latlngs="45.949280, -1.060721;46.010368, -1.207999;46.143195, -1.169084;46.086784, -1.413285;43.385487, -9.319087;43.035375, -9.691507;42.383533, -8.941904;41.907471, -11.198254;33.060625, -16.313535;32.645166, -16.910648;29.228242, -13.503012;27.639640, -17.981654;16.752764, -22.980459;16.165836, -22.922330;16.567492, -24.363488;16.891315, -25.014272;16.840363, -25.302602;11.997176, -61.776996;12.633068, -61.357369;14.433577, -60.894062;15.874891, -61.615184;18.147249, -63.041428;18.400406, -64.601915;19.408029, -69.741230;21.786500, -72.042126;23.676423, -76.113085;25.074060, -77.301517;25.719779, -76.695299;32.371256, -64.663970;39.379027, -31.167602;37.737325, -25.664269;46.146532, -1.185531"]
    
    [leaflet-marker lat=45.949280 lng=-1.060721]1[/leaflet-marker]
    [leaflet-marker lat=46.010368 lng=-1.207999]2[/leaflet-marker]
    [leaflet-marker lat=46.143195 lng=-1.169084]3[/leaflet-marker]
    ...

    Deux problèmes se :
    – le weight=3 ne fonctionne pas (peut importe la valeur).
    – chaque lignes avec un shortcode lealet-map se traduit par une ligne vide sur la page, avec un nombre important de marqueurs c’est bien visible sur le site.

    IS there a complete liste of tags (color, weight, etc.) available somewhere?
    Is there a way to add labels?

    Plugin Author bozdoz

    (@bozdoz)

    No way to add labels. I just pushed an update to the plugin to allow all style options, from here: https://leafletjs.com/reference-1.0.3.html#path

    See : https://imgur.com/XbJtfYx.jpg

    And : https://imgur.com/rij0qpX.jpg

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Custom style on shortcode leaflet-line or leaflet-geojson’ is closed to new replies.