当前位置:网站首页>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
边栏推荐
- Usage of functions decode() and replace() in SQL
- std::stoi stol stoul stoll stof stod
- 開關電源設計分享及電源設計技巧圖解
- 从技术体系到商业洞察,中小研发团队架构实践之收尾篇
- [play with lighthouse] Tencent cloud lightweight server builds a full platform video analysis video download website
- An 8266 crash
- Sogou cell thesaurus analysis (only extract words and word frequency)
- After opening the original normal project, the dependency package displays red and does not exist.
- 该买什么设备,Keysight 给你挑好了
- Wechat applet part of the mobile phone Preview PDF did not respond
猜你喜欢

One of the reasons why the WebView web page cannot be opened (and some WebView problem records encountered by myself)

SQL常用的命令

12个例子夯实promise基础

Sword finger offer II 116 Number of provinces - spatial complexity O (n), time complexity O (n)

Wechat applet part of the mobile phone Preview PDF did not respond
![[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born](/img/0a/ed4eab6589e1c072edc247463e889e.png)
[today in history] April 23: the first video uploaded on YouTube; Netease cloud music officially launched; The inventor of digital audio player was born

Practice of Druid SQL and security in meituan review

Android Development: the client obtains the latest value in the database in real time and displays it on the interface
![[记录]TypeError: this.getOptions is not a function](/img/c9/0d92891b6beec3d6085bd3da516f00.png)
[记录]TypeError: this.getOptions is not a function

WebView opens H5 video and displays gray background or black triangle button. Problem solved
随机推荐
[popular science] CRC verification (I) what is CRC verification?
c1000k TCP 连接上限测试
Usage of functions decode() and replace() in SQL
Coolweather is revised and connected to the wind weather interface to realize the broken line diagram of temperature
Resolution: cnpm: unable to load file \cnpm. PS1, because running scripts is prohibited on this system
2022.04.23(LC_714_买卖股票的最佳时机含手续费)
Use of kotlin collaboration in the project
The corresponding permissions required to automatically open the app in the setting interface through accessibility service
Treatment of incomplete display of listview height
Simple use of navigation in jetpack
Seata handles distributed transactions
FTP, SSH Remote Access and control
12 examples to consolidate promise Foundation
Recyclerview control list item layout match_ Fundamental principle of parent attribute invalidation
Click the input box to pop up the keyboard layout and move up
Sentinel rule persistence into Nacos
ESP32 LVGL8. 1 - calendar (calendar 25)
OpenHarmony开源开发者成长计划,寻找改变世界的开源新生力!
Circuit on-line simulation
[record] typeerror: this getOptions is not a function