如何用OpenLayers画扇形
答案:1 悬赏:10 手机版
解决时间 2021-11-19 17:11
- 提问者网友:不要迷恋哥
- 2021-11-18 23:19
如何用OpenLayers画扇形
最佳答案
- 五星知识达人网友:野慌
- 2021-11-18 23:30
/使用OpenLayers.Layer.Vector,map要先建立
var vectors,lineFeature;//存放线路
//线路样式
var style_green = {
strokeColor: "#00FF00",
strokeWidth: 3,
strokeDashstyle: "dashdot",
pointRadius: 6,
pointerEvents: "visiblePainted"
};
//画线图层设置
var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
layer_style.fillOpacity = 0.2;
layer_style.graphicOpacity = 1;
//画线图层
vectors = new OpenLayers.Layer.Vector("Simple Geometry", {style: layer_style});
map.addLayer(vectors);
//一下采用数组型式填充轨迹
var pointList = [];
for(var i=0;i<5;i++){
newPoint = new OpenLayers.Geometry.Point(lon,lan);
pointList.push(newPoint);
}
lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList),null,style_green);
vectors.addFeatures([lineFeature]);
var vectors,lineFeature;//存放线路
//线路样式
var style_green = {
strokeColor: "#00FF00",
strokeWidth: 3,
strokeDashstyle: "dashdot",
pointRadius: 6,
pointerEvents: "visiblePainted"
};
//画线图层设置
var layer_style = OpenLayers.Util.extend({}, OpenLayers.Feature.Vector.style['default']);
layer_style.fillOpacity = 0.2;
layer_style.graphicOpacity = 1;
//画线图层
vectors = new OpenLayers.Layer.Vector("Simple Geometry", {style: layer_style});
map.addLayer(vectors);
//一下采用数组型式填充轨迹
var pointList = [];
for(var i=0;i<5;i++){
newPoint = new OpenLayers.Geometry.Point(lon,lan);
pointList.push(newPoint);
}
lineFeature = new OpenLayers.Feature.Vector(new OpenLayers.Geometry.LineString(pointList),null,style_green);
vectors.addFeatures([lineFeature]);
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯