私はMapstractionを使用しており、呼び出してポリゴンを描画しようとしていますmap.addFeature('polygon');
それは例外を示しています
Uncaught TypeError: Object [object Object] has no method 'addFeature'
なぜこの例外が発生するのですか?
JS コード:
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);
map.addPolyline(polygon)
map.addFeature('polygon', polyPoints);