使用Mapstraction拖动(移动)多边形

时间:2013-07-03 09:51:16

标签: maps openlayers geocoding polygon mapstraction

我正在努力找到一种使用Mapstraction拖动多边形的方法。 但是没有找到任何这方面的例子。

在这种情况下如何拖动多边形?

JS我试过的代码

// initialise the map with your choice of API
        var mapstraction = new mxn.MapstractionInteractive('mapstraction','openlayers');
        mapstraction.setCenterAndZoom(new mxn.LatLonPoint(40, -3),5);
        var latlon = new mxn.LatLonPoint(17.384225, 78.486586);
        mapstraction.setCenterAndZoom(latlon, 10);

          var polyPoint;
          var polyPoints = []
          //Adding polygon to map
          polyPoint = new mxn.LatLonPoint(17.447612 , 78.223686)
          polyPoints.push(polyPoint);
          polyPoint = new mxn.LatLonPoint(17.504593 , 78.306084)
          polyPoints.push(polyPoint);
          polyPoint = new mxn.LatLonPoint(17.471193 , 78.417320)
          polyPoints.push(polyPoint);
          polyPoint = new mxn.LatLonPoint(17.414201 , 78.470879)
          polyPoints.push(polyPoint);

          var polygon = new mxn.Polyline(polyPoints);
          polygon.setClosed(true);
          mapstraction.addPolyline(polygon)

0 个答案:

没有答案