Skip to content
0
  • Home
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
  • Home
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Sketchy)
  • No Skin
Collapse

Wandering Adventure Party

Andy ZeigertZ

zeigert@mastodon.social

@zeigert@mastodon.social
About
Posts
1
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

View Original

Posts

Recent Best Controversial

  • #Leaflet question:
    Andy ZeigertZ Andy Zeigert

    @juergen_hubert Fairly simple with some basic javascript.

    Most basic for markers:

    const layer = new L.geoJSON(data, {
    onEachFeature: (feature, layer) => {
    layer.on({
    click: (e) => {
    map.panTo(e.target.getLatLng());
    }
    })
    }
    });

    There are slight variations depending on what kind of layer you're using, but search the docs for map.panTo or map.zoomTo. You can add events as a function of a layer group, or add the event to the marker layer as it's added. Does that help?

    Uncategorized leaflet
  • Login

  • Login or register to search.
Powered by NodeBB Contributors
  • First post
    Last post