Leaflet.draw geojson图层编辑

时间:2016-03-06 13:56:45

标签: javascript leaflet leaflet.draw

正如您在fiddle中看到的那样,我有一个像这样的多边形:

var data = [{
"type": "Feature",
"geometry": {
    "type": "Polygon",
    "coordinates": [
      [
        [2.504410743713379,44.28253972334941],
        [2.504410743713379,44.28929846767132],
        [2.5168561935424805,44.28929846767132],
        [2.5168561935424805,44.28253972334941],
        [2.504410743713379,44.28253972334941]
      ]
    ]
  }}]

当我想将它添加到我的featureGroup drawnItems时,我使用:

var geojsonLayer = L.geoJson(data);
geojsonLayer.getLayers()[0].addTo(drawnItems);

然后我决定编辑多边形我不能移动它,因为中心移动处理程序没有出现,但是当我使用工具栏绘制新的多边形时,我有移动处理程序。 enter image description here

你能帮帮我吗? 如何添加我的多边形以具有移动处理程序?

0 个答案:

没有答案