当前位置:网站首页>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 foundation 3
- ESP32 LVGL8. 1 - bar progress bar (bar 21)
- SSDB Foundation
- Oracle配置st_geometry
- 从技术体系到商业洞察,中小研发团队架构实践之收尾篇
- Go language GUI framework Fyne Chinese garbled or not displayed
- [advanced level 11 of C language -- character and string functions and their simulation implementation (2)]
- Fundamentals of machine learning theory -- some terms about machine learning
- openlayers draw矩形
- SSDB foundation 1
猜你喜欢
Practice of Druid SQL and security in meituan review
ArcMap连接 arcgis server
微搭低代码零基础入门课(第三课)
该买什么设备,Keysight 给你挑好了
ESP32 LVGL8. 1 - roller rolling (roller 24)
Introduction to ROS learning notes (I)
From technical system to business insight, the closing chapter of the practice of small and medium-sized R & D team structure
MySQL Téléchargement et installation de la version Linux
ESP32 LVGL8. 1 - calendar (calendar 25)
MVVM model
随机推荐
Use of content provider
MySQL Téléchargement et installation de la version Linux
WebView saves the last browsing location
mysql_ Download and installation of Linux version
Redis optimization series (III) solve common problems after master-slave configuration
Esp32 (UART event) - serial port event learning (1)
电路在线模拟
网络协议之:sctp流控制传输协议
Yyds dry goods inventory stringprep --- Internet string preparation
arcgis js api dojoConfig配置
openlayers 5.0 热力图
C1000k TCP connection upper limit test 1
One stop service platform for high-level talents and development of comprehensive service platform system for talents
Screen right-click menu in souI
Practice of Druid SQL and security in meituan review
Eight bit binary multiplier VHDL
The type initializer for ‘Gdip‘ threw an exception
Codeforces Round #784 (Div. 4)
SSDB foundation 1
Nacos cluster construction and MySQL persistence configuration