Cesium 鷹眼地圖功能


1. 效果圖

2. 核心代碼

var ext = getExtent(this.viewer),
    i = L.latLng(ext.ymin, ext.xmin),
    s = L.latLng(ext.ymax, ext.xmax),
    bounds = L.latLngBounds(i, s);
if (this.rectangle ? this.rectangle.setBounds(bounds) : this.rectangle = L.rectangle(bounds, this.showStyle).addTo(this.map), -180 == ext.xmin && 180 == ext.xmax && 90 == ext.ymax && -90 == ext.ymin) {
    var center = getCenter(this.viewer);
    this.map.setView([center.y, center.x], 0),
    this.rectangle.setStyle(this.hideStyle)
}
else {
    var oBounds = bounds.pad(.5);
    this.map.fitBounds(oBounds),
    this.rectangle.setStyle(this.showStyle)
}

3. 源碼下載

小專欄:https://xiaozhuanlan.com/topic/5489273106


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM