1
我希望能爲我的問題找到一個快速答案。Angularjs Openlayer繪製折線
我正在使用openlayer指令(https://github.com/tombatossals/angular-openlayers-directive)在我的應用程序中繪製地圖。 我想將折線添加到在此地圖上顯示路線的地圖上。
我找不到任何解決方案。可以畫這些線嗎?
謝謝你的幫助!
我希望能爲我的問題找到一個快速答案。Angularjs Openlayer繪製折線
我正在使用openlayer指令(https://github.com/tombatossals/angular-openlayers-directive)在我的應用程序中繪製地圖。 我想將折線添加到在此地圖上顯示路線的地圖上。
我找不到任何解決方案。可以畫這些線嗎?
謝謝你的幫助!
如果你想畫設定點之間的線,第一變換每個座標
points.push(ol.proj.transform([xx,yy],'EPSG:4326', 'EPSG:3857'));
然後創建LineString的幾何
var thing = new ol.geom.LineString(points);
,並創建一個功能,並把它添加到層
var feature = new ol.Feature({
name: "Thing",
geometry: thing
})
});
vectorSource.addFeature(feature);