当前位置:网站首页>openlayers draw矩形
openlayers draw矩形
2022-04-23 19:08:00 【Gis烤羊腿真好吃】
var webgissource={};
webgissource.measure = new VectorSource();
webgissource.measurelayer = new Vectorlayer({
source: webgissource.measure,
style: new Style({
fill: new Fill({
color: 'rgba(255, 255, 255, 0.2)'
}),
stroke: new Stroke({
color: '#ffcc33',
width: 2
}),
image: new Icon({
//color: '#4271AE',
scale:0.7,
src: 'static/img/greenpoint.png'
}),
})
});
map.addLayer(webgissource.measurelayer)
measureparms.draw = new Draw({
source: webgissource.measure,
type: “LineString”,
style: new Style({
fill: new Fill({
color: 'rgba(0,0,0,0.2)'
}),
stroke: new Stroke({
color: 'rgba(0, 0, 0, 0.5)',
lineDash: [10, 10],
width: 2
}),
image: new CircleStyle({
radius: 5,
stroke: new Stroke({
color: 'rgba(0, 0, 0, 0.7)'
}),
fill: new Fill({
color: 'rgba(255, 255, 255, 0.2)'
})
})
}),
maxPoints: 2,
geometryFunction: function(coordinates, geometry){
var start = coordinates[0];
var end = coordinates[1];
if(!geometry){
geometry=new Polygon([
[start, [start[0], end[1]], end, [end[0], start[1]], start]
]);
}
geometry.setCoordinates([
[start, [start[0], end[1]], end, [end[0], start[1]], start]
]);
return geometry;
}
});
版权声明
本文为[Gis烤羊腿真好吃]所创,转载请带上原文链接,感谢
https://blog.csdn.net/weixin_38190600/article/details/93224774
边栏推荐
- Introduction to ROS learning notes (II)
- 剑指 Offer II 116. 省份数量-空间复杂度O(n),时间复杂度O(n)
- ESP32 LVGL8. 1 - img picture (IMG 20)
- ESP32 LVGL8. 1 - bar progress bar (bar 21)
- Get a list of recent apps
- binlog2sql 工具安装使用及问题汇总
- How about CICC wealth? Is it safe to open an account up there
- The type initializer for ‘Gdip‘ threw an exception
- Raspberry pie uses root operation, and the graphical interface uses its own file manager
- JVM的类加载过程
猜你喜欢
ESP32 LVGL8. 1 - bar progress bar (bar 21)
Download xshell 6 and xftp6 official websites
Introduction to micro build low code zero Foundation (lesson 3)
Installation, use and problem summary of binlog2sql tool
Keysight has chosen what equipment to buy for you
Some records used by VS2010
7、 DOM (Part 2) - chapter after class exercises and answers
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
Using Visual Studio code to develop Arduino
ESP32 LVGL8. 1. Detailed migration tutorial of m5stack + lvgl + IDF (27)
随机推荐
Client interns of a large factory share their experience face to face
The fifth bullet of MySQL learning -- detailed explanation of transaction and its operation characteristics
ESP32 LVGL8. 1 - input devices (input devices 18)
MySQL statement
SSDB基础3
ESP32 LVGL8. 1 - textarea text area (textarea 26)
Practice of Druid SQL and security in meituan review
How can programmers quickly develop high-quality code?
Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation
SSDB基础2
Implementation of TCP UDP communication with golang language
SSDB foundation 1
Zlib realizes streaming decompression
On the forced conversion of C language pointer
Xlslib use
在渤海期货办理开户安全吗。
Is it safe to open an account in Bohai futures.
C1000k TCP connection upper limit test
该买什么设备,Keysight 给你挑好了
MVVM model