当前位置:网站首页>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
边栏推荐
- Dynamically add and delete layouts
- Coolweather is revised and connected to the wind weather interface to realize the broken line diagram of temperature
- Redis optimization series (III) solve common problems after master-slave configuration
- Zlib realizes streaming decompression
- 机器学习理论基础篇--关于机器学习的一些术语
- ESP32 LVGL8. 1 - roller rolling (roller 24)
- 12个例子夯实promise基础
- The type initializer for ‘Gdip‘ threw an exception
- RPM包管理
- Esp32 (UART event) - serial port event learning (1)
猜你喜欢
ESP32 LVGL8. 1 - input devices (input devices 18)
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
Esp32 (UART receiving and sending) - receiving and sending communication of serial port (4)
Openharmony open source developer growth plan, looking for new open source forces that change the world!
The difference between ordinary inner class and static inner class
Download xshell 6 and xftp6 official websites
微搭低代码零基础入门课(第三课)
Introduction to ROS learning notes (I)
2022.04.23 (lc_763_divided into letter interval)
Eight bit binary multiplier VHDL
随机推荐
One stop service platform for high-level talents and development of comprehensive service platform system for talents
About the operation of unit file reading (I)
[play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
ESP32 LVGL8. 1 - arc (arc 19)
Nacos cluster construction and MySQL persistence configuration
腾讯云GPU最佳实践-使用jupyter pycharm远程开发训练
Using bafayun to control the computer
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
ESP32 LVGL8. 1 - checkbox (checkbox 23)
Sentinel规则持久化进Nacos
网络协议之:sctp流控制传输协议
[记录]TypeError: this.getOptions is not a function
在渤海期货办理开户安全吗。
7、 DOM (Part 2) - chapter after class exercises and answers
Redis optimization series (III) solve common problems after master-slave configuration
: app: transformclasseswithrobustfordevrease meituan hot repair compilation error record
Usage of functions decode() and replace() in SQL
电路在线模拟
简化路径(力扣71)
Use of kotlin collaboration in the project