
OpenLayers
干到60岁退休的码农
这个作者很懒,什么都没留下…
展开
-
OpenLayers ol-ext:Transform 对象,旋转、拉伸、放大
OpenLayers引用ol-ext:Transform能够对Feature图形进行放大、缩小、移动、旋转、拉伸等操作,非常好用。代码: transformFeature() { var _this = this if (this.transform !== null || this.transform !== '') { this.map.removeInteraction(this.transform) } this.editM.原创 2020-05-20 21:21:14 · 2599 阅读 · 0 评论 -
OpenLayers 画圆画椭圆
var draw; // global so we can remove it laterfunction addInteraction() { var value = typeSelect.value; if (value !== 'None') { draw = new Draw({ source: source, type: 'Circle' }); map.addInteraction(draw); }}这是OpenLayers官方原创 2020-05-14 16:02:47 · 2071 阅读 · 0 评论 -
OpenLayers Draw绘制时删除最后一个点
this.draw.removeLastPoint()Remove last point of the feature currently being drawn.操作方法:可以通过键盘快捷键操作,比如说ESC,删除当前正在绘制的图形的最后一点。原创 2020-05-13 16:03:35 · 1553 阅读 · 0 评论 -
OpenLayers Draw绘制时操作结束绘制
this.draw.finishDrawing()Stop drawing and add the sketch feature to the target layer. The module:ol/interaction/Draw~DrawEventType.DRAWEND event is dispatched before inserting the feature.使用方法:可以通过键盘快捷键操作,结束draw绘制,将当前绘制的图形添加到目标图层中。...原创 2020-05-13 15:57:15 · 4261 阅读 · 0 评论 -
OpenLayers禁用鼠标双击放大事件
方案1:var map=new ol.Map({ layers:[new ol.layer.Tile({ source:new ol.source.OSM() })], target:"map", view:new ol.View({ center:[0,0], zoom:0 }), interactions:new ol.interaction.defaults({ doubleClickZoom:false,原创 2020-05-13 15:43:00 · 1949 阅读 · 1 评论 -
OpenLayers API整理
本文主要为整理的Openlayers 的知识笔记,随着运用不断加深理解,也会不断更新。一、创建地图地图Map创建地图底图:需要用new ol.Map({})地图map是由图层layers、一个可视化视图view、用于修改地图内容的交互interaction以及使用UI组件的控件control组成的。地图事件含义click无拖动单击...转载 2019-12-30 14:31:31 · 755 阅读 · 0 评论 -
OpenLayers Layer删除Feature
var copyLayer = VectorLayer[i];copyLayer.getSource().removeFeature(feature);map.removeLayer(VectorLayer[i]);delete (VectorLayer[i]);VectorLayer[i] = copyLayer;map.addLayer(VectorLayer[i]);map.up...原创 2019-11-22 11:19:11 · 9415 阅读 · 0 评论 -
OpenLayers重新加载图层数据
var now = Date.now();var format = selectedLayerSource.getFormat();var url = selectedLayerSource.getUrl();url = url + '?t=' + now;//make AJAX request to source url$.ajax({ url: url, succe...原创 2019-10-22 15:14:01 · 4345 阅读 · 3 评论 -
OpenLayers设置显示文本
var nonTextStyle = new ol.style.Style({ //把点的样式换成ICON图标 fill: new ol.style.Fill({ //填充颜色 color: 'rgba(37,241,239,0.2)' ...原创 2019-10-16 11:36:21 · 6536 阅读 · 0 评论 -
OpenLayers不显示放大放小按钮,自定义控件
//实例化比例尺控件(ScaleLine) var scaleLine = new ol.control.ScaleLine({ //设置比例尺单位,degrees、imperial、us、nautical、metric(度量单位) units: "metric" }); var mousePosition = new ol.control....原创 2019-07-05 14:44:02 · 3619 阅读 · 0 评论 -
OpenLayers3加载高德地图
AMapSource.jsol.source.AMap = function(options){ var options = options ? options : {}; var attributions; if(options.attributions !== undefined){ attributions = option.attribution...原创 2019-05-07 09:43:49 · 3317 阅读 · 0 评论 -
OpenLayers3加载百度地图
BaiduMapSource.js/** * 加载百度地图 * @returns {ol.layer.Tile} */function loadBaiduMap() { //数据源信息 var attribution = new ol.Attribution({ html: 'Copyright:© 2015 Baidu, i-cubed...原创 2019-05-07 09:37:54 · 2855 阅读 · 4 评论 -
OpenLayers3加载谷歌地图
HTML关键代码:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head>...原创 2019-05-07 09:22:19 · 2120 阅读 · 0 评论