123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151 |
- define(['vendorDir/map23dlib/TileEntity',
- 'vendorDir/map23dlib/MemStream',
- 'vendorDir/map23dlib/VTPMarkerProvider',
- 'vendorDir/data/boundary'], function(){
- /**
- * 状态值
- * @type {Boolean}
- * @default false
- * @private
- */
- var status = {
- initialized:false,//是否初始化
- isOpenSetting:false,//是否打开设置框
- Sun3D:false,
- showLine3D:false
- };
- /**
- * 模块数据 用于数据存储和外部调用
- * @type {Object}
- * 数据存放
- */
- var modValue = {
- model3D:false,//3D建筑模型
- photography:false,//倾斜摄影模型
- };
- /**
- * 3维地球初始化
- */
- function init(){
- if(!status.initialized){
- map3DViewer.map.extend(Cesium.viewerCesiumNavigationMixin, {});
- //地图移动
- map3DViewer.map.scene.camera.moveEnd.addEventListener(function () {
- //var center = map3DViewer.getCurCameraInfos();
- var ellipsoid = map3DViewer.map.scene.globe.ellipsoid;
- var height = ellipsoid.cartesianToCartographic(map3DViewer.map.camera.position).height;
- if (map23DData.display.map2D) {
- ONEMAP.C.publisher.publish(map2DViewer.map.getZoom(), 'mapChange23D');
- } else if (map23DData.display.map3D) {
- ONEMAP.C.publisher.publish(height, 'mapChange23D');
- }
- })
- addBoundary(); //加载国境线
- //添加地名层
- // add3DName();
- }
- status.initialized = true;
- };
- function add3DName(){
- modValue.name_tile_zh = new Cesium.Entity({
- id: 'name_tile_zh',
- show: false
- })
- //温度
- var options = {
- url: map23DConfig.map23DAssetsUrl + '/scripts/vendor/Apps/SampleData/zc/marker.vtc',
- tileUrlTemplate: onemapUrlConfig.defaultGlobalSettingData.baseMap3D.map3DName,
- metadataUrl: map23DConfig.map23DAssetsUrl + '/scripts/vendor/Apps/SampleData/zc/marker.xml',
- fatherGroup: modValue.name_tile_zh,
- maxZoom: [11, 14],
- minZoom: [8, 4],
- };
- modValue.featureProvider = new VTPMarkerProvider(Cesium, options);
- modValue.featureProvider.viewer = map3DViewer.map;
- //modValue.name_tile_zh.show = true;
- }
- /**
- * 加载国境线
- */
- function addBoundary() {
- for (var wi = 0, wl = worldPolyline.length; wi < wl; wi++) {
- DrawworldPolyline('country', worldPolyline[wi], 'wline' + wi);
- }
- for (var pi = 0, pl = provincePolyline.length; pi < pl; pi++) {
- DrawworldPolyline('province', provincePolyline[pi], 'pline' + pi);
- }
- }
- function DrawworldPolyline(type, lineData, name) {
- var pnts = [];
- for (var i = 0, l = lineData.length; i < l; i++) {
- pnts.push(lineData[i][0], lineData[i][1]);
- }
- if (type == 'country') {
- // map3DViewer.map.
- map3DViewer.map.entities.add({
- name: name,
- polyline: {
- positions: Cesium.Cartesian3.fromDegreesArray(pnts),
- clampToGround: true,
- width: 2,
- material: new Cesium.PolylineGlowMaterialProperty({
- color: Cesium.Color.fromBytes(255, 255, 0, 130)
- }),
- distanceDisplayCondition: new Cesium.DistanceDisplayCondition(700000, 70000000000)
- }
- });
- } else if (type == 'province') {
- map3DViewer.map.entities.add({
- name: name,
- polyline: {
- positions: Cesium.Cartesian3.fromDegreesArray(pnts),
- clampToGround: true,
- width: 1,
- material: new Cesium.PolylineGlowMaterialProperty({
- color: Cesium.Color.fromBytes(255, 255, 0, 130)
- }),
- distanceDisplayCondition: new Cesium.DistanceDisplayCondition(700000, 70000000000)
- }
- });
- }
- }
- /**
- * 注册监听
- */
- function subscribe(){
-
- };
- function setLayout(){
-
- };
- function bindEvent(){
-
- };
- /**
- * 加载/移除3d模型
- * @return {[type]} [description]
- */
- function add3DCSMX(flag){
-
- };
- /**
- * 加载/移除倾斜摄影
- * @return {[type]} [description]
- */
- function add3DQXSY(flag){
-
- };
- /**
- * 清除标注
- *
- */
- function clear3DMap(){
-
- }
- return ONEMAP.M.tdEarth = {
- init:init,
- modValue:modValue
- }
- })
|