editor: Center on object after loading new coords
This commit is contained in:
parent
ba466fe474
commit
94c05d5358
@ -76,6 +76,13 @@ if (editor_mode) {
|
||||
polyline = L.polyline(coords).addTo(mymap);
|
||||
// polyline.on('dragend', onDragEnd); // TODO: Doesn't work, see "workaround" below
|
||||
polyline.enableEdit();
|
||||
if (interactive) {
|
||||
console.log(coords);
|
||||
latlng = L.latLng(coords[0][0] + (coords[coords.length - 1][0] - coords[0][0]) / 2,
|
||||
coords[0][1] + (coords[coords.length - 1][1] - coords[0][1]) / 2);
|
||||
console.log("NEW=" + latlng);
|
||||
jump_to(latlng, 8);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user