¶Ô±ÈÐÂÎļþ |
| | |
| | | .map-marker-label { |
| | | background-color: antiquewhite; |
| | | } |
| | |
| | | MapUtil.drawSector3(result[0], windDir, windSpeed); |
| | | |
| | | // 2. ç»å¶å¯¹è¯æ¡ |
| | | const window = DialogUtil.createInfoWindow2(factor, () => { |
| | | DialogUtil.openNewWindow2(factor, MapUtil._map, result[0], () => { |
| | | // ç§»é¤æå½¢åºå |
| | | MapUtil.clearSector3(); |
| | | // MapUtil.clearSector3(); |
| | | }); |
| | | window.open(MapUtil._map, result[0]); |
| | | // 3. è¶å¿å¾è·³è½¬å®ä½ |
| | | var f = this.factorDatas.factor[this.factorType + 1 + '']; |
| | | const progress = FChart.locate( |
| | |
| | | var DialogUtil = { |
| | | show: true, |
| | | toggleDataDialog() { |
| | | this.show = !this.show; |
| | | if (this.show) { |
| | | return 'æ°æ®å¼¹æ¡ï¼å¼'; |
| | | } else { |
| | | return 'æ°æ®å¼¹æ¡ï¼å
³'; |
| | | } |
| | | }, |
| | | /** |
| | | * åå»ºå¼¹åºæ¡ |
| | | * @param {*} factorDatas çæµæ°æ® |
| | |
| | | info.appendChild(bottom); |
| | | return info; |
| | | }, |
| | | |
| | | openNewWindow(factorDatas, i, map, position, onClose) { |
| | | if (!this.show) return |
| | | const window = this.createInfoWindow(factorDatas, i, onClose) |
| | | window.open(map, position); |
| | | }, |
| | | |
| | | openNewWindow2(factorData, map, position, onClose) { |
| | | if (!this.show) return |
| | | const window = this.createInfoWindow2(factorData, onClose) |
| | | window.open(map, position); |
| | | } |
| | | }; |
| | |
| | | this._map.remove(views); |
| | | }, |
| | | |
| | | addMarkers(markers) { |
| | | addElasticMarkers(markers) { |
| | | const zoomStyleMapping = { |
| | | 14: 0, |
| | | 15: 0, |
| | | 16: 0, |
| | | 17: 0, |
| | | 18: 0, |
| | | 19: 0, |
| | | 20: 0, |
| | | }; |
| | | const mList = []; |
| | | markers.forEach((m) => { |
| | | var marker = new AMap.Marker({ |
| | | position: new AMap.LngLat(m.lng, m.lat), // ç»çº¬åº¦å¯¹è±¡ï¼ä¹å¯ä»¥æ¯ç»çº¬åº¦ææçä¸ç»´æ°ç»[116.39, 39.9] |
| | | let name = m.name; |
| | | if (m.name.length > 9) { |
| | | const i = m.name.length / 2; |
| | | const str1 = m.name.slice(0, i + 1); |
| | | const str2 = m.name.slice(i + 1, m.name.length); |
| | | name = `${str1}<br />${str2}`; |
| | | } |
| | | var marker = new AMap.ElasticMarker({ |
| | | title: m.name, |
| | | offset: new AMap.Pixel(-13, -12), |
| | | // anchor: 'center', |
| | | icon: new AMap.Icon({ |
| | | image: './asset/mipmap/c_level_no.png', |
| | | // imageSize: [12, 12], |
| | | }), |
| | | zoom: [14, 20], |
| | | position: new AMap.LngLat(m.lng, m.lat), |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/scene.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 14, //æåéççº§å« |
| | | scaleFactor: 1.4, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1, //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>${name}</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15, |
| | | }, |
| | | }, |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping, |
| | | }); |
| | | mList.push(marker); |
| | | }); |
| | |
| | | |
| | | // åå»ºæ ·å¼å¯¹è±¡ |
| | | var styleObject = { |
| | | url: 'https://a.amap.com/jsapi_demos/static/images/mass0.png', |
| | | url: 'https://a.amap.com/jsapi_demos/static/images/mass1.png', |
| | | // url: './asset/mipmap/ic_up_white.png', // 徿 å°å |
| | | size: new AMap.Size(11, 11), // 徿 å¤§å° |
| | | anchor: new AMap.Pixel(5, 5), // 徿 æ¾ç¤ºä½ç½®åç§»éï¼åºåç¹ä¸ºå¾æ å·¦ä¸è§ |
| | | }; |
| | | var massMarks = new AMap.MassMarks(data, { |
| | | zIndex: 5, // æµ·éç¹å¾å±å å çé¡ºåº |
| | | zooms: [3, 18], // 卿å®å°å¾ç¼©æ¾çº§å«èå´å
å±ç¤ºæµ·éç¹å¾å± |
| | | zooms: [15, 18], // 卿å®å°å¾ç¼©æ¾çº§å«èå´å
å±ç¤ºæµ·éç¹å¾å± |
| | | style: styleObject, // è®¾ç½®æ ·å¼å¯¹è±¡ |
| | | }); |
| | | massMarks.on('click', (event) => { |
| | |
| | | this.drawSector3(lnglats[i], windDir, windSpeed); |
| | | |
| | | // 2. ç»å¶å¯¹è¯æ¡ |
| | | const window = DialogUtil.createInfoWindow(fDatas, i, () => { |
| | | DialogUtil.openNewWindow(fDatas, i, MapUtil._map, lnglats[i], () => { |
| | | // ç§»é¤æå½¢åºå |
| | | this.clearSector3(); |
| | | // this.clearSector3(); |
| | | }); |
| | | window.open(MapUtil._map, lnglats[i]); |
| | | |
| | | // 3. è¶å¿å¾è·³è½¬å®ä½ |
| | | const progress = FChart.locate( |
| | |
| | | _sector: undefined, |
| | | _sectorViews3: {}, |
| | | drawSector3: function (lnglat, windDir, windSpeed) { |
| | | // this._map.remove(MapUtil._sectorViews) |
| | | // MapUtil._sectorViews = [] |
| | | if (windSpeed > 10) { |
| | | return; |
| | | } |
| | | if (MapUtil._sectorViews3['text10'] != undefined) { |
| | | this.clearSector3(); |
| | | } |
| | | |
| | | var sector = new AMap.Object3D.Mesh(); |
| | |
| | | geometry.faces.push(index + 3, index + 4, index + 5); |
| | | geometry.faces.push(index + 4, index + 5, index + 6); |
| | | } |
| | | |
| | | if (this._sector != undefined) { |
| | | this._object3Dlayer.remove(this._sector); |
| | | } |
| | | this._object3Dlayer.add(sector); |
| | | this._sector = sector; |
| | | |
| | | distance = distance.toFixed(0); |
| | | distance2 = distance2.toFixed(0); |
| | | const zoomStyleMapping = { |
| | | 14: 0, |
| | | 15: 0, |
| | | 16: 0, |
| | | 17: 0, |
| | | 18: 0, |
| | | 19: 0, |
| | | 20: 0, |
| | | }; |
| | | //10åéæå½¢ |
| | | if (MapUtil._sectorViews3['text10'] == undefined) { |
| | | var text15 = new AMap.Text({ |
| | | text: '10åé', |
| | | position: list[2], |
| | | // animation: "AMAP_ANIMATION_DROP" |
| | | }); |
| | | MapUtil._sectorViews3['text10'] = text15; |
| | | var textM = new AMap.Text({ |
| | | text: distance + 'm', |
| | | position: list[1], |
| | | // animation: "AMAP_ANIMATION_DROP" |
| | | }); |
| | | MapUtil._sectorViews3['textM'] = textM; |
| | | } else { |
| | | MapUtil._sectorViews3['text10'].setPosition(list[2]); |
| | | MapUtil._sectorViews3['textM'].setPosition(list[1]); |
| | | MapUtil._sectorViews3['textM'].setText(distance + 'm'); |
| | | } |
| | | var text15 = new AMap.ElasticMarker({ |
| | | zoom: [14, 20], |
| | | position: list[2], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1, //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: '<div>10åé</div>', |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15, |
| | | }, |
| | | }, |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping, |
| | | }); |
| | | MapUtil._sectorViews3['text10'] = text15; |
| | | var textM = new AMap.ElasticMarker({ |
| | | zoom: [14, 20], |
| | | position: list[1], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1, //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>${distance}m</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15, |
| | | }, |
| | | }, |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping, |
| | | }); |
| | | MapUtil._sectorViews3['textM'] = textM; |
| | | MapUtil._map.add(MapUtil._sectorViews3['text10']); |
| | | MapUtil._map.add(MapUtil._sectorViews3['textM']); |
| | | |
| | | // 缩æ¾å°å¾å°åéçè§éçº§å« |
| | | // if (animation != false) { |
| | | // MapUtil._map.setFitView([bezierCurve, line1, line2]) |
| | | // } |
| | | |
| | | //5åéæå½¢ |
| | | |
| | | pList = list2; |
| | | // MapUtil._map.setCenter(pList[0]) |
| | | path = [ |
| | | [pList[0].lng, pList[0].lat], |
| | | [pList[1].lng, pList[1].lat, pList[2].lng, pList[2].lat], |
| | | ]; |
| | | |
| | | if (MapUtil._sectorViews3['textM5'] == undefined) { |
| | | var bezierCurve = new AMap.BezierCurve({ |
| | | path: path, |
| | | // isOutline: true, |
| | | // outlineColor: '#ffeeff', |
| | | borderWeight: 1, |
| | | strokeColor: '#ffeeff', |
| | | strokeOpacity: 1, |
| | | // strokeWeight: 6, |
| | | // çº¿æ ·å¼è¿æ¯æ 'dashed' |
| | | strokeStyle: 'solid', |
| | | // strokeStyleæ¯dashedæ¶ææ |
| | | strokeDasharray: [10, 10], |
| | | lineJoin: 'round', |
| | | lineCap: 'round', |
| | | zIndex: 50, |
| | | }); |
| | | // bezierCurve.setMap(MapUtil._map) |
| | | // MapUtil._sectorViews3['bezierCurve'] = bezierCurve |
| | | |
| | | var text5 = new AMap.Text({ |
| | | text: '5åé', |
| | | position: pList[1], |
| | | // animation: "AMAP_ANIMATION_DROP" |
| | | }); |
| | | MapUtil._sectorViews3['text5'] = text5; |
| | | var textM5 = new AMap.Text({ |
| | | text: distance2 + 'm', |
| | | position: pList[0], |
| | | // animation: "AMAP_ANIMATION_DROP" |
| | | }); |
| | | MapUtil._sectorViews3['textM5'] = textM5; |
| | | } else { |
| | | // MapUtil._sectorViews3['bezierCurve'].setPath(path) |
| | | MapUtil._sectorViews3['text5'].setPosition(pList[1]); |
| | | MapUtil._sectorViews3['textM5'].setPosition(pList[0]); |
| | | MapUtil._sectorViews3['textM5'].setText(distance2 + 'm'); |
| | | } |
| | | var text5 = new AMap.ElasticMarker({ |
| | | position: pList[1], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1, //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>5åé</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15, |
| | | }, |
| | | }, |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping, |
| | | }); |
| | | MapUtil._sectorViews3['text5'] = text5; |
| | | var textM5 = new AMap.ElasticMarker({ |
| | | position: pList[0], |
| | | styles: [ |
| | | { |
| | | icon: { |
| | | img: './asset/mipmap/location.png', |
| | | size: [16, 16], //å¯è§åºåçå¤§å° |
| | | ancher: [8, 16], //éç¹ |
| | | fitZoom: 18, //æåéççº§å« |
| | | scaleFactor: 1, //å°å¾æ¾å¤§ä¸çº§çç¼©æ¾æ¯ä¾ç³»æ° |
| | | maxScale: 2, //æå¤§æ¾å¤§æ¯ä¾ |
| | | minScale: 1, //æå°æ¾å¤§æ¯ä¾ |
| | | }, |
| | | label: { |
| | | content: `<div>${distance2}m</div>`, |
| | | offset: [-35, 0], |
| | | position: 'BM', |
| | | minZoom: 15, |
| | | }, |
| | | }, |
| | | ], |
| | | zoomStyleMapping: zoomStyleMapping, |
| | | }); |
| | | MapUtil._sectorViews3['textM5'] = textM5; |
| | | MapUtil._map.add(MapUtil._sectorViews3['textM5']); |
| | | MapUtil._map.add(MapUtil._sectorViews3['text5']); |
| | | |
| | |
| | | lat: v.latitude, |
| | | }; |
| | | }); |
| | | this._markList = MapUtil.addMarkers(markers); |
| | | this._markList = MapUtil.addElasticMarkers(markers); |
| | | } |
| | | ); |
| | | }, |
| | |
| | | <link rel="stylesheet" href="./css/border.css?v=6"> |
| | | <link rel="stylesheet" href="./css/component.css?v=3"> |
| | | <link rel="stylesheet" href="./css/jackwei.slider.css?v=2"> |
| | | <link rel="stylesheet" href="./css//myBootstrap.css"> |
| | | <link rel="stylesheet" href="./css/myBootstrap.css"> |
| | | <link rel="stylesheet" href="./css/text.css"> |
| | | <style type="text/css"> |
| | | /* å»é¤é«å¾·å°å¾çåºå®çå·å¾æ */ |
| | | .amap-logo { |
| | |
| | | } |
| | | .amap-overlays { |
| | | z-index: 0; |
| | | } |
| | | .amap-marker-label{ |
| | | /* width: 100px; |
| | | max-width: 200px; */ |
| | | font-size: 13px; |
| | | text-align: center; |
| | | color: white; |
| | | background-color: transparent; |
| | | text-shadow: black 2px 2px 2px; |
| | | border-radius: 2px; |
| | | border: 0px; |
| | | padding: 4px; |
| | | /* white-space: pre-wrap; */ |
| | | } |
| | | </style> |
| | | |
| | |
| | | <i class="fa fa-compass" aria-hidden="true"></i> |
| | | <span>æ°æ®æ è®°ï¼å¼</span> |
| | | </button> |
| | | <button id="btn_data_dialog" type="button" class="btn btn-outline-info btn-block"> |
| | | <i class="fa fa-compass" aria-hidden="true"></i> |
| | | <span>æ°æ®å¼¹æ¡ï¼å¼</span> |
| | | </button> |
| | | </form> |
| | | </div> |
| | | </div> |
| | |
| | | b.toggleClass('btn-outline-info'); |
| | | $(b.children('span').get(0)).text(text); |
| | | }); |
| | | $('#btn_data_dialog').on('click', function () { |
| | | var text = DialogUtil.toggleDataDialog(); |
| | | var b = $(this); |
| | | b.toggleClass('btn-outline-secondary'); |
| | | b.toggleClass('btn-outline-info'); |
| | | $(b.children('span').get(0)).text(text); |
| | | }); |
| | | |
| | | /************************åå²è½¨è¿¹å¨ç»***********************************/ |
| | | $('#btn_stop').on('click', function () { |