当前位置:网站首页>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
边栏推荐
- Minesweeping II of souI instance
- Sentinel rule persistence into Nacos
- Solutions such as unknown or garbled code or certificate problem prompt in Charles's mobile phone packet capture, actual measurement.
- 浅谈c语言指针的强制转换
- ESP32 LVGL8. 1 - img picture (IMG 20)
- WebView saves the last browsing location
- 7、 DOM (Part 2) - chapter after class exercises and answers
- Go language GUI framework Fyne Chinese garbled or not displayed
- Introduction to ROS learning notes (I)
- Click the input box to pop up the keyboard layout and move up
猜你喜欢
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born
On the forced conversion of C language pointer
Wechat video extraction and receiving file path
12个例子夯实promise基础
mysql_linux版本的下載及安裝詳解
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
【历史上的今天】4 月 23 日:YouTube 上传第一个视频;网易云音乐正式上线;数字音频播放器的发明者出生
Android Development: the client obtains the latest value in the database in real time and displays it on the interface
Client interns of a large factory share their experience face to face
Introduction to ROS learning notes (I)
随机推荐
Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)
【C语言进阶11——字符和字符串函数及其模拟实现(2))】
Go language GUI framework Fyne Chinese garbled or not displayed
SSDB foundation 1
简化路径(力扣71)
Codeforces Round #784 (Div. 4)
PyGame tank battle
Simple use of navigation in jetpack
mysql_ Download and installation of Linux version
Class loading process of JVM
剑指 Offer II 116. 省份数量-空间复杂度O(n),时间复杂度O(n)
ESP32 LVGL8. 1 - calendar (calendar 25)
Keysight has chosen what equipment to buy for you
RPM package management
[报告] Microsoft :Application of deep learning methods in speech enhancement
arcgis js api dojoConfig配置
Esp01s with Arduino development environment
Wechat applet part of the mobile phone Preview PDF did not respond
8266 obtain 18b20 temperature
Disable Ctrl + Alt + Del