index.vue 19.5 KB
Newer Older
fxy060608's avatar
fxy060608 已提交
1
<template>
2 3
  <uni-map
    :id="id"
Q
qiang 已提交
4
    v-on="$listeners"
fxy060608's avatar
fxy060608 已提交
5
  >
Q
qiang 已提交
6 7 8 9 10
    <map-marker
      v-for="item in markers"
      :key="item.id"
      v-bind="item"
    />
11 12
    <map-polygon
      v-for="item in polygons"
13
      :key="JSON.stringify(item.points)"
14 15
      v-bind="item"
    />
d-u-a's avatar
d-u-a 已提交
16 17
    <div
      ref="map"
Q
qiang 已提交
18
      style="width: 100%; height: 100%; position: relative; overflow: hidden"
fxy060608's avatar
fxy060608 已提交
19
    />
Q
qiang 已提交
20 21 22 23 24 25 26 27 28 29
    <div
      style="
        position: absolute;
        top: 0;
        width: 100%;
        height: 100%;
        overflow: hidden;
        pointer-events: none;
      "
    >
X
xiaoyucoding 已提交
30
      <slot />
郭胜强 已提交
31 32
    </div>
  </uni-map>
fxy060608's avatar
fxy060608 已提交
33 34 35 36 37 38
</template>

<script>
import {
  subscriber
} from 'uni-mixins'
39

Q
qiang 已提交
40 41
import { hexToRgba } from 'uni-shared'

X
xiaoyucoding 已提交
42
import {
Q
qiang 已提交
43 44 45 46
  loadMaps
} from './maps'

import mapMarker from './map-marker'
47
import mapPolygon from './map-polygon'
X
xiaoyucoding 已提交
48

Q
qiang 已提交
49 50
import { ICON_PATH_ORIGIN } from '../../../helpers/location'

Q
qiang 已提交
51 52 53
function getLat (latLng) {
  if ('getLat' in latLng) {
    return latLng.getLat()
54
  } else {
Q
qiang 已提交
55 56 57 58 59 60 61 62 63
    return latLng.lat()
  }
}

function getLng (latLng) {
  if ('getLng' in latLng) {
    return latLng.getLng()
  } else {
    return latLng.lng()
64 65 66
  }
}

fxy060608's avatar
fxy060608 已提交
67 68
export default {
  name: 'Map',
Q
qiang 已提交
69
  components: {
70 71
    mapMarker,
    mapPolygon
Q
qiang 已提交
72
  },
fxy060608's avatar
fxy060608 已提交
73 74 75 76 77 78
  mixins: [subscriber],
  props: {
    id: {
      type: String,
      default: ''
    },
79
    latitude: {
fxy060608's avatar
fxy060608 已提交
80
      type: [String, Number],
81
      default: 39.92
fxy060608's avatar
fxy060608 已提交
82
    },
83
    longitude: {
fxy060608's avatar
fxy060608 已提交
84
      type: [String, Number],
85
      default: 116.46
fxy060608's avatar
fxy060608 已提交
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102
    },
    scale: {
      type: [String, Number],
      default: 16
    },
    markers: {
      type: Array,
      default () {
        return []
      }
    },
    covers: {
      type: Array,
      default () {
        return []
      }
    },
103
    includePoints: {
fxy060608's avatar
fxy060608 已提交
104 105 106 107 108
      type: Array,
      default () {
        return []
      }
    },
109
    polyline: {
fxy060608's avatar
fxy060608 已提交
110 111 112 113 114
      type: Array,
      default () {
        return []
      }
    },
115
    circles: {
fxy060608's avatar
fxy060608 已提交
116 117 118 119 120
      type: Array,
      default () {
        return []
      }
    },
121
    controls: {
fxy060608's avatar
fxy060608 已提交
122 123 124 125 126 127 128 129
      type: Array,
      default () {
        return []
      }
    },
    showLocation: {
      type: [Boolean, String],
      default: false
Q
qiang 已提交
130 131 132 133 134 135
    },
    libraries: {
      type: Array,
      default () {
        return []
      }
136 137 138 139
    },
    polygons: {
      type: Array,
      default: () => []
fxy060608's avatar
fxy060608 已提交
140 141 142 143 144
    }
  },
  data () {
    return {
      center: {
145 146
        latitude: 116.46,
        longitude: 116.46
fxy060608's avatar
fxy060608 已提交
147 148 149 150 151
      },
      isMapReady: false,
      isBoundsReady: false,
      polylineSync: [],
      circlesSync: [],
152
      controlsSync: []
fxy060608's avatar
fxy060608 已提交
153 154 155
    }
  },
  watch: {
156 157
    latitude () {
      this.centerChange()
fxy060608's avatar
fxy060608 已提交
158
    },
159 160
    longitude () {
      this.centerChange()
fxy060608's avatar
fxy060608 已提交
161 162 163
    },
    scale (val) {
      this.mapReady(() => {
164
        this._map.setZoom(Number(val) || 16)
fxy060608's avatar
fxy060608 已提交
165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
      })
    },
    polyline (val) {
      this.mapReady(() => {
        this.createPolyline()
      })
    },
    circles () {
      this.mapReady(() => {
        this.createCircles()
      })
    },
    controls () {
      this.mapReady(() => {
        this.createControls()
      })
    },
    includePoints () {
      this.mapReady(() => {
        this.fitBounds(this.includePoints)
      })
    },
    showLocation (val) {
      this.mapReady(() => {
        this[val ? 'createLocation' : 'removeLocation']()
      })
    }
  },
  created () {
Q
qiang 已提交
194
    this._markers = {}
fxy060608's avatar
fxy060608 已提交
195 196 197 198 199 200 201 202
    var latitude = this.latitude
    var longitude = this.longitude
    if (latitude && longitude) {
      this.center.latitude = latitude
      this.center.longitude = longitude
    }
  },
  mounted () {
Q
qiang 已提交
203 204
    loadMaps(this.libraries, result => {
      this._maps = result
fxy060608's avatar
fxy060608 已提交
205 206 207 208 209 210 211 212 213 214 215 216 217 218
      this.init()
    })
  },
  beforeDestroy () {
    this.removePolyline()
    this.removeCircles()
    this.removeControls()
    this.removeLocation()
  },
  methods: {
    _handleSubscribe ({
      type,
      data = {}
    }) {
Q
qiang 已提交
219
      const maps = this._maps
fxy060608's avatar
fxy060608 已提交
220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236
      function callback (res, err) {
        res = res || {}
        res.errMsg = `${type}:${err ? 'fail' + err : 'ok'}`
        var cb = err ? data.fail : data.success
        if (typeof cb === 'function') {
          cb(res)
        }
        if (typeof data.complete === 'function') {
          data.complete(res)
        }
      }

      switch (type) {
        case 'getCenterLocation':
          this.mapReady(() => {
            var latitude
            var longitude
237
            var center = this._map.getCenter()
Q
qiang 已提交
238 239
            latitude = getLat(center)
            longitude = getLng(center)
fxy060608's avatar
fxy060608 已提交
240 241 242 243 244 245 246

            callback({
              latitude: latitude,
              longitude: longitude
            })
          })
          break
Q
qiang 已提交
247 248 249 250 251 252 253 254
        case 'moveToLocation':
          {
            const { latitude, longitude } = data
            var locationPosition = (latitude && longitude) ? new maps.LatLng(latitude, longitude) : this._locationPosition
            if (locationPosition) {
              this._map.setCenter(locationPosition)
              callback({})
            }
fxy060608's avatar
fxy060608 已提交
255 256 257 258 259 260 261 262 263 264
          }
          break
        case 'translateMarker':
          this.mapReady(() => {
            try {
              var marker = this.getMarker(data.markerId)
              var destination = data.destination
              var duration = data.duration
              var autoRotate = !!data.autoRotate
              var rotate = Number(data.rotate) ? data.rotate : 0
Q
qiang 已提交
265 266 267 268
              let rotation = 0
              if ('getRotation' in marker) {
                rotation = marker.getRotation()
              }
fxy060608's avatar
fxy060608 已提交
269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309
              var a = marker.getPosition()
              var b = new maps.LatLng(destination.latitude, destination.longitude)
              var distance = maps.geometry.spherical.computeDistanceBetween(a, b) / 1000
              var time = ((typeof duration === 'number') ? duration : 1000) / (1000 * 60 * 60)
              var speed = distance / time
              var movingEvent = maps.event.addListener(marker, 'moving', e => {
                var latLng = e.latLng
                var label = marker.label
                if (label) {
                  label.setPosition(latLng)
                }
                var callout = marker.callout
                if (callout) {
                  callout.setPosition(latLng)
                }
              })
              var event = maps.event.addListener(marker, 'moveend', e => {
                event.remove()
                movingEvent.remove()
                marker.lastPosition = a
                marker.setPosition(b)
                var label = marker.label
                if (label) {
                  label.setPosition(b)
                }
                var callout = marker.callout
                if (callout) {
                  callout.setPosition(b)
                }
                var cb = data.animationEnd
                if (typeof cb === 'function') {
                  cb()
                }
              })
              var lastRtate = 0
              if (autoRotate) {
                if (marker.lastPosition) {
                  lastRtate = maps.geometry.spherical.computeHeading(marker.lastPosition, a)
                }
                rotate = maps.geometry.spherical.computeHeading(a, b) - lastRtate
              }
Q
qiang 已提交
310 311 312 313 314 315 316 317 318
              if ('setRotation' in marker) {
                marker.setRotation(rotation + rotate)
              }
              if ('moveTo' in marker) {
                marker.moveTo(b, speed)
              } else {
                marker.setPosition(b)
                maps.event.trigger(marker, 'moveend', {})
              }
fxy060608's avatar
fxy060608 已提交
319 320 321 322 323 324 325 326 327 328
            } catch (error) {
              callback(null, error)
            }
          })
          break
        case 'includePoints':
          this.fitBounds(data.points)
          break
        case 'getRegion':
          this.boundsReady(() => {
329
            var latLngBounds = this._map.getBounds()
fxy060608's avatar
fxy060608 已提交
330 331 332 333
            var southwest = latLngBounds.getSouthWest()
            var northeast = latLngBounds.getNorthEast()
            callback({
              southwest: {
Q
qiang 已提交
334 335
                latitude: getLat(southwest),
                longitude: getLng(southwest)
fxy060608's avatar
fxy060608 已提交
336 337
              },
              northeast: {
Q
qiang 已提交
338 339
                latitude: getLat(northeast),
                longitude: getLng(northeast)
fxy060608's avatar
fxy060608 已提交
340 341 342 343 344 345 346
              }
            })
          })
          break
        case 'getScale':
          this.mapReady(() => {
            callback({
347
              scale: this._map.getZoom()
fxy060608's avatar
fxy060608 已提交
348 349 350 351 352 353
            })
          })
          break
      }
    },
    init () {
Q
qiang 已提交
354
      const maps = this._maps
fxy060608's avatar
fxy060608 已提交
355
      var center = new maps.LatLng(this.center.latitude, this.center.longitude)
356
      var map = this._map = new maps.Map(this.$refs.map, {
fxy060608's avatar
fxy060608 已提交
357 358
        center,
        zoom: Number(this.scale),
359
        // scrollwheel: false,
fxy060608's avatar
fxy060608 已提交
360 361 362 363
        disableDoubleClickZoom: true,
        mapTypeControl: false,
        zoomControl: false,
        scaleControl: false,
364
        panControl: false,
Q
qiang 已提交
365 366 367
        fullscreenControl: false,
        streetViewControl: false,
        keyboardShortcuts: false,
fxy060608's avatar
fxy060608 已提交
368 369 370 371 372 373 374 375 376 377
        minZoom: 5,
        maxZoom: 18,
        draggable: true
      })
      var boundsChangedEvent = maps.event.addListener(map, 'bounds_changed', e => {
        boundsChangedEvent.remove()
        this.isBoundsReady = true
        this.$emit('boundsready')
      })
      maps.event.addListener(map, 'click', () => {
378 379
        // TODO 编译器将 tap 转换为click
        this.$trigger('click', {}, {})
fxy060608's avatar
fxy060608 已提交
380 381 382
      })
      maps.event.addListener(map, 'dragstart', () => {
        this.$trigger('regionchange', {}, {
383 384
          type: 'begin',
          causedBy: 'gesture'
fxy060608's avatar
fxy060608 已提交
385 386
        })
      })
387 388 389 390 391
      function getMapInfo () {
        var center = map.getCenter()
        return {
          scale: map.getZoom(),
          centerLocation: {
Q
qiang 已提交
392 393
            latitude: getLat(center),
            longitude: getLng(center)
394 395 396
          }
        }
      }
fxy060608's avatar
fxy060608 已提交
397
      maps.event.addListener(map, 'dragend', () => {
398 399 400 401
        this.$trigger('regionchange', {}, Object.assign({
          type: 'end',
          causedBy: 'drag'
        }, getMapInfo()))
fxy060608's avatar
fxy060608 已提交
402 403 404
      })
      maps.event.addListener(map, 'zoom_changed', () => {
        this.$emit('update:scale', map.getZoom())
405 406 407 408
        this.$trigger('regionchange', {}, Object.assign({
          type: 'end',
          causedBy: 'scale'
        }, getMapInfo()))
fxy060608's avatar
fxy060608 已提交
409 410 411 412 413
      })
      maps.event.addListener(map, 'center_changed', () => {
        var latitude
        var longitude
        var center = map.getCenter()
Q
qiang 已提交
414 415
        latitude = getLat(center)
        longitude = getLng(center)
fxy060608's avatar
fxy060608 已提交
416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437
        this.$emit('update:latitude', latitude)
        this.$emit('update:longitude', longitude)
      })
      if (this.polyline && Array.isArray(this.polyline) && this.polyline.length) {
        this.createPolyline()
      }
      if (this.circles && Array.isArray(this.circles) && this.circles.length) {
        this.createCircles()
      }
      if (this.controls && Array.isArray(this.controls) && this.controls.length) {
        this.createControls()
      }
      if (this.showLocation) {
        this.createLocation()
      }
      if (this.includePoints && Array.isArray(this.includePoints) && this.includePoints.length) {
        this.fitBounds(this.includePoints, () => {
          map.setCenter(center)
        })
      }
      this.isMapReady = true
      this.$emit('mapready')
Q
qiang 已提交
438
      this.$trigger('updated', {}, {})
fxy060608's avatar
fxy060608 已提交
439
    },
440
    centerChange () {
Q
qiang 已提交
441
      const maps = this._maps
442 443 444 445 446 447 448 449 450 451 452 453
      var latitude = Number(this.latitude)
      var longitude = Number(this.longitude)
      if (latitude !== this.center.latitude || longitude !== this.center.longitude) {
        this.center.latitude = latitude
        this.center.longitude = longitude
        if (this._map) {
          this.mapReady(() => {
            this._map.setCenter(new maps.LatLng(latitude, longitude))
          })
        }
      }
    },
fxy060608's avatar
fxy060608 已提交
454
    createPolyline () {
Q
qiang 已提交
455
      const maps = this._maps
456
      var map = this._map
fxy060608's avatar
fxy060608 已提交
457 458 459 460 461 462 463
      var polyline = this.polylineSync
      this.removePolyline()
      this.polyline.forEach(option => {
        var path = []
        option.points.forEach(point => {
          path.push(new maps.LatLng(point.latitude, point.longitude))
        })
Q
qiang 已提交
464 465 466 467 468 469 470 471 472
        const borderWidth = Number(option.borderWidth) || 0
        const { r: sr, g: sg, b: sb, a: sa } = hexToRgba(option.color)
        const { r: br, g: bg, b: bb, a: ba } = hexToRgba(option.borderColor)
        const polylineOptions = {
          map,
          clickable: false,
          path,
          strokeWeight: option.width + borderWidth,
          strokeDashStyle: option.dottedLine ? 'dash' : 'solid'
fxy060608's avatar
fxy060608 已提交
473
        }
Q
qiang 已提交
474
        const polylineBorderOptions = {
fxy060608's avatar
fxy060608 已提交
475 476 477 478 479
          map,
          clickable: false,
          path,
          strokeWeight: option.width,
          strokeDashStyle: option.dottedLine ? 'dash' : 'solid'
Q
qiang 已提交
480 481 482 483 484 485 486 487 488 489 490 491 492 493
        }
        if ('Color' in maps) {
          polylineOptions.strokeColor = new maps.Color(sr, sg, sb, sa)
          polylineBorderOptions.strokeColor = new maps.Color(br, bg, bb, ba)
        } else {
          polylineOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`
          polylineOptions.strokeOpacity = sa
          polylineBorderOptions.strokeColor = `rgb(${br}, ${bg}, ${bb})`
          polylineBorderOptions.strokeOpacity = ba
        }
        if (borderWidth) {
          polyline.push(new maps.Polyline(polylineBorderOptions))
        }
        polyline.push(new maps.Polyline(polylineOptions))
fxy060608's avatar
fxy060608 已提交
494 495 496 497 498 499 500 501 502 503
      })
    },
    removePolyline () {
      var polyline = this.polylineSync
      polyline.forEach(line => {
        line.setMap(null)
      })
      polyline.splice(0, polyline.length)
    },
    createCircles () {
Q
qiang 已提交
504
      const maps = this._maps
505
      var map = this._map
fxy060608's avatar
fxy060608 已提交
506 507 508 509 510
      var circles = this.circlesSync
      this.removeCircles()
      this.circles.forEach(option => {
        var center = new maps.LatLng(option.latitude, option.longitude)

Q
qiang 已提交
511
        const circleOptions = {
fxy060608's avatar
fxy060608 已提交
512 513 514 515
          map,
          center,
          clickable: false,
          radius: option.radius,
Q
qiang 已提交
516
          strokeWeight: Number(option.strokeWidth) || 1,
fxy060608's avatar
fxy060608 已提交
517
          strokeDashStyle: 'solid'
Q
qiang 已提交
518 519 520 521 522 523 524 525 526 527 528 529 530
        }
        const { r: fr, g: fg, b: fb, a: fa } = hexToRgba(option.fillColor || '#00000000')
        const { r: sr, g: sg, b: sb, a: sa } = hexToRgba(option.color || '#000000')
        if ('Color' in maps) {
          circleOptions.fillColor = new maps.Color(fr, fg, fb, fa)
          circleOptions.strokeColor = new maps.Color(sr, sg, sb, sa)
        } else {
          circleOptions.fillColor = `rgb(${fr}, ${fg}, ${fb})`
          circleOptions.fillOpacity = fa
          circleOptions.strokeColor = `rgb(${sr}, ${sg}, ${sb})`
          circleOptions.strokeOpacity = sa
        }
        var circle = new maps.Circle(circleOptions)
fxy060608's avatar
fxy060608 已提交
531 532 533 534 535 536 537 538 539 540 541
        circles.push(circle)
      })
    },
    removeCircles () {
      var circles = this.circlesSync
      circles.forEach(circle => {
        circle.setMap(null)
      })
      circles.splice(0, circles.length)
    },
    createControls () {
Q
qiang 已提交
542
      const maps = this._maps
543
      var _self = this
544
      var map = this._map
fxy060608's avatar
fxy060608 已提交
545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568
      var controls = this.controlsSync
      this.removeControls()
      this.controls.forEach(option => {
        var position = option.position || {}
        var control = document.createElement('div')
        var img = new Image()
        control.appendChild(img)
        var style = control.style
        style.position = 'absolute'
        style.width = 0
        style.height = 0
        img.onload = () => {
          if (option.position.width) {
            img.width = option.position.width
          }
          if (option.position.height) {
            img.height = option.position.height
          }
          var style = img.style
          style.position = 'absolute'
          style.left = (position.left || 0) + 'px'
          style.top = (position.top || 0) + 'px'
          style.maxWidth = 'initial'
        }
569
        img.src = this.$getRealPath(option.iconPath)
570
        img.onclick = function ($event) {
fxy060608's avatar
fxy060608 已提交
571
          if (option.clickable) {
572
            _self.$trigger('controltap', $event, {
fxy060608's avatar
fxy060608 已提交
573 574 575
              controlId: option.id
            })
          }
576
        }
fxy060608's avatar
fxy060608 已提交
577 578 579 580 581 582 583 584 585 586 587 588
        map.controls[maps.ControlPosition.TOP_LEFT].push(control)
        controls.push(control)
      })
    },
    removeControls () {
      var controls = this.controlsSync
      controls.forEach(control => {
        control.remove()
      })
      controls.splice(0, controls.length)
    },
    createLocation () {
Q
qiang 已提交
589
      const maps = this._maps
590 591
      var map = this._map
      var location = this._location
fxy060608's avatar
fxy060608 已提交
592 593 594 595 596 597
      if (location) {
        this.removeLocation()
      }
      uni.getLocation({
        type: 'gcj02',
        success: (res) => {
598
          if (location !== this._location) {
fxy060608's avatar
fxy060608 已提交
599 600 601 602 603 604
            return
          }
          var position = new maps.LatLng(res.latitude, res.longitude)
          location = new maps.Marker({
            position,
            map,
Q
qiang 已提交
605
            icon: new maps.MarkerImage(ICON_PATH_ORIGIN, null, null, new maps.Point(22, 22), new maps.Size(44, 44)),
fxy060608's avatar
fxy060608 已提交
606 607 608
            flat: true,
            rotation: 0
          })
609
          this._location = location
fxy060608's avatar
fxy060608 已提交
610
          refreshLocation()
Q
qiang 已提交
611
          this.__onCompassChange = function (res) {
fxy060608's avatar
fxy060608 已提交
612
            location.setRotation(res.direction)
Q
qiang 已提交
613 614
          }
          uni.onCompassChange(this.__onCompassChange)
fxy060608's avatar
fxy060608 已提交
615 616 617 618 619 620 621 622
        },
        fail: e => {
          console.error(e)
        }
      })
      var self = this

      function refreshLocation () {
623
        if (location !== self._location) {
fxy060608's avatar
fxy060608 已提交
624 625 626 627 628 629
          return
        }
        setTimeout(() => {
          uni.getLocation({
            type: 'gcj02',
            success: (res) => {
630
              var locationPosition = self._locationPosition = new maps.LatLng(res.latitude, res.longitude)
fxy060608's avatar
fxy060608 已提交
631 632 633 634 635 636 637 638 639
              location.setPosition(locationPosition)
            },
            fail: e => {
              console.error(e)
            },
            complete: () => {
              refreshLocation()
            }
          })
Q
qiang 已提交
640
        }, 30000)
fxy060608's avatar
fxy060608 已提交
641 642 643
      }
    },
    removeLocation () {
644
      var location = this._location
fxy060608's avatar
fxy060608 已提交
645 646
      if (location) {
        location.setMap(null)
647 648
        this._location = null
        this._locationPosition = null
Q
qiang 已提交
649
        uni.offCompassChange(this.__onCompassChange)
fxy060608's avatar
fxy060608 已提交
650 651 652
      }
    },
    fitBounds (points, cb) {
Q
qiang 已提交
653
      const maps = this._maps
fxy060608's avatar
fxy060608 已提交
654
      this.boundsReady(() => {
655
        var map = this._map
fxy060608's avatar
fxy060608 已提交
656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688
        var bounds = new maps.LatLngBounds()

        points.forEach(point => {
          var longitude = point.longitude
          var latitude = point.latitude
          var latLng = new maps.LatLng(latitude, longitude)
          bounds.extend(latLng)
        })
        map.fitBounds(bounds)
        if (typeof cb === 'function') {
          cb()
        }
      })
    },
    mapReady (cb) {
      if (this.isMapReady) {
        cb()
      } else {
        this.$once('mapready', () => {
          cb()
        })
      }
    },
    boundsReady (cb) {
      if (this.isBoundsReady) {
        cb()
      } else {
        this.$once('boundsready', () => {
          cb()
        })
      }
    },
    getMarker (id) {
Q
qiang 已提交
689 690 691
      var marker = this._markers[id]
      if (!marker) {
        throw new Error('translateMarker: fail cannot find marker with id ' + id)
fxy060608's avatar
fxy060608 已提交
692
      }
Q
qiang 已提交
693
      return marker
fxy060608's avatar
fxy060608 已提交
694 695 696 697 698 699
    }
  }
}
</script>

<style>
X
xiaoyucoding 已提交
700 701 702 703 704 705 706 707 708 709
	uni-map {
		position: relative;
		width: 300px;
		height: 150px;
		display: block;
	}

	uni-map[hidden] {
		display: none;
	}
d-u-a's avatar
d-u-a 已提交
710
</style>