当前位置:网站首页>Openlayers draw rectangle
Openlayers draw rectangle
2022-04-23 19:08:00 【GIS roast lamb leg is delicious】
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 roast lamb leg is delicious]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231908121102.html
边栏推荐
- SSDB基础3
- openlayers 5.0 加载arcgis server 切片服务
- SSDB Foundation
- Minesweeping II of souI instance
- Feature selection feature_ selection--SelectKBest
- Use of content provider
- 12个例子夯实promise基础
- redis优化系列(三)解决主从配置后的常见问题
- Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)
- PyGame tank battle
猜你喜欢
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
Class loading process of JVM
WebView opens H5 video and displays gray background or black triangle button. Problem solved
FTP、ssh远程访问及控制
From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
该买什么设备,Keysight 给你挑好了
One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)
Raspberry pie uses root operation, and the graphical interface uses its own file manager
[record] typeerror: this getOptions is not a function
随机推荐
Esp32 (UART event) - serial port event learning (1)
Installation, use and problem summary of binlog2sql tool
js 计算时间差
開關電源設計分享及電源設計技巧圖解
Raspberry pie uses root operation, and the graphical interface uses its own file manager
Nacos as service registry
After opening the original normal project, the dependency package displays red and does not exist.
ESP32 LVGL8. 1 - checkbox (checkbox 23)
[记录]TypeError: this.getOptions is not a function
I just want to leave a note for myself
【玩转Lighthouse】腾讯云轻量服务器搭建全平台视频解析视频下载网站
ESP32 LVGL8. 1 - arc (arc 19)
SQL常用的命令
Simple use of viewbinding
About the operation of unit file reading (I)
SSDB基础3
Go language GUI framework Fyne Chinese garbled or not displayed
Getting started with vcpkg
从技术体系到商业洞察,中小研发团队架构实践之收尾篇
Methods of nested recycleview to solve sliding conflict and incomplete item display