TransWikia.com

Preventing map panning to last drawn marker using Leaflet?

Geographic Information Systems Asked by FredFury on January 5, 2021

I have a basic Leaflet map where I need to draw several markers and lines on.
How do I prevent the map from panning to the last drawn object?

I’ve read about setting autopan : False for popups from here.

Can the autopan : false option work for leaflet markers?

One Answer

It appears that you can.

var markerWithoutPan = new L.Marker([0, -10], {
    draggable: true,
    autoPan: false,
    title: 'NoPan'
});

Source

Leaflet docs for Markers

Answered by SIRHAMY on January 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP