maptalk地图以及自定义标点的引入
                                                            生活随笔
收集整理的這篇文章主要介紹了
                                maptalk地图以及自定义标点的引入
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.                        
                                
                            
                            
                            this.map = new maptalks.Map("mapDiv", {center: [this.coordinate[0].x, this.coordinate[0].y],zoom: 8.8,minZoom: 3,maxZoom: 16,attribution: false, //隱藏logspatialReference: "EPSG:3857",baseLayer: new maptalks.TileLayer("base", {urlTemplate:"https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}.jpg",}),// layers: [//   new maptalks.VectorLayer('A', [new maptalks.Marker([119.04, 37.18])]) //紅色位置圖標(biāo)// ]
});
//圖標(biāo)圖層添加到這張地圖上
this.markerLayer = new maptalks.VectorLayer('vector').addTo(this.map);
this.toolLayer = new maptalks.VectorLayer('mapvector');
// 圖標(biāo)以及點(diǎn)擊事件
this.coordinate.forEach((item) => {let button =  "assets/img/bigscreem/button.png";var marker = new maptalks.Marker([item.x, item.y], {symbol: {markerFile: require(`@/${button}`),markerWidth: 40,markerHeight: 49,markerDx: 0,markerDy: 0,// markerOpacity: 0.1,markerFill: '#3EEAC6',   //內(nèi)部填充色// markerLineColor: 'red',  //邊框顏色'textName': item.name,'textFill': '#fff','textHorizontalAlignment': 'bottom','textSize': 14,textDx: 10}})//將圖標(biāo)添加到圖標(biāo)圖層marker.addTo(this.markerLayer)marker.on('click', function () {that.tab = item.name;})
});
                            
                        
                        
                        總結(jié)
以上是生活随笔為你收集整理的maptalk地图以及自定义标点的引入的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
                            
                        - 上一篇: 使用html5 canvas绘制简单图形
 - 下一篇: python+vue 税务申报系统