forked from MTSR/mapserver
Move center to marker when clicked (#388)
* Pan center to the marker upon clicking * Properly bind onPopupOpen * Messed up parameter types * Fine-tune panTo parameters * This should be the fix * So yet again I forgot to save * Move impllentation back to AbstractIconOverlay * cleanup * Yet another attempt * Move panTo to marker
This commit is contained in:
parent
ff1b0dc47a
commit
89ea214d02
@ -9,7 +9,6 @@ import RealtimeTileLayer from './RealtimeTileLayer.js';
|
||||
|
||||
import config from '../config.js';
|
||||
|
||||
|
||||
export function createMap(node, layerId, zoom, lat, lon){
|
||||
|
||||
const cfg = config.get();
|
||||
|
@ -121,6 +121,11 @@ export default L.LayerGroup.extend({
|
||||
popup = self.createPopup(obj);
|
||||
if (popup)
|
||||
marker.bindPopup(popup);
|
||||
|
||||
marker.on('click', function () {
|
||||
self.map.panTo(marker.getLatLng());
|
||||
});
|
||||
|
||||
marker.addTo(self);
|
||||
|
||||
self.currentObjects[hash] = marker;
|
||||
|
Loading…
Reference in New Issue
Block a user