@map-colonies/react-components 3.15.1 → 4.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/@map-colonies/react-components.es.js +3662 -0
- package/dist/@map-colonies/react-components.umd.js +24 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_0.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_1.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_10.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_11.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_12.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_13.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_14.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_15.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_16.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_17.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_18.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_19.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_2.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_20.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_21.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_22.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_23.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_24.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_25.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_26.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_27.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_3.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_4.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_5.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_6.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_7.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_8.json +1 -0
- package/dist/Cesium/Assets/IAU2006_XYS/IAU2006_XYS_9.json +1 -0
- package/dist/Cesium/Assets/Images/bing_maps_credit.png +0 -0
- package/dist/Cesium/Assets/Images/cesium_credit.png +0 -0
- package/dist/Cesium/Assets/Images/google_earth_credit.png +0 -0
- package/dist/Cesium/Assets/Images/ion-credit.png +0 -0
- package/dist/Cesium/Assets/Textures/LensFlare/DirtMask.jpg +0 -0
- package/dist/Cesium/Assets/Textures/LensFlare/StarBurst.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/0/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/0/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/0/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/1/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/2/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/2/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/3/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/1/3/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/0/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/1/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/2/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/3/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/4/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/5/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/6/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/0.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/1.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/2.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/2/7/3.jpg +0 -0
- package/dist/Cesium/Assets/Textures/NaturalEarthII/tilemapresource.xml +14 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mx.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_my.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_mz.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_px.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_py.jpg +0 -0
- package/dist/Cesium/Assets/Textures/SkyBox/tycho2t3_80_pz.jpg +0 -0
- package/dist/Cesium/Assets/Textures/maki/airfield.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/airport.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/alcohol-shop.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/america-football.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/art-gallery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bakery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bank.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bar.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/baseball.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/basketball.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/beer.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bicycle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/building.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/bus.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cafe.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/camera.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/campsite.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/car.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cemetery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cesium.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/chemist.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cinema.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/circle-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/circle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/city.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/clothing-store.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/college.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/commercial.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cricket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/cross.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/dam.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/danger.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/disability.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/dog-park.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/embassy.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/emergency-telephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/entrance.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/farm.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fast-food.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/ferry.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fire-station.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/fuel.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/garden.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/gift.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/golf.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/grocery.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/hairdresser.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/harbor.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/heart.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/heliport.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/hospital.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/ice-cream.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/industrial.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/land-use.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/laundry.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/library.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/lighthouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/lodging.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/logging.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/london-underground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/marker-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/marker.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/minefield.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/mobilephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/monument.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/museum.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/music.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/oil-well.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/park.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/park2.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/parking-garage.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/parking.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/pharmacy.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/pitch.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/place-of-worship.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/playground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/police.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/polling-place.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/post.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/prison.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-above.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-light.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-metro.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail-underground.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rail.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-christian.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-jewish.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/religious-muslim.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/restaurant.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/roadblock.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/rocket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/school.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/scooter.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/shop.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/skiing.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/slaughterhouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/soccer.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/square-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/square.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/star-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/star.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/suitcase.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/swimming.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/telephone.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/tennis.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/theatre.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/toilets.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/town-hall.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/town.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/triangle-stroked.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/triangle.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/village.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/warehouse.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/waste-basket.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/water.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/wetland.png +0 -0
- package/dist/Cesium/Assets/Textures/maki/zoo.png +0 -0
- package/dist/Cesium/Assets/Textures/moonSmall.jpg +0 -0
- package/dist/Cesium/Assets/Textures/pin.svg +1 -0
- package/dist/Cesium/Assets/Textures/waterNormals.jpg +0 -0
- package/dist/Cesium/Assets/Textures/waterNormalsSmall.jpg +0 -0
- package/dist/Cesium/Assets/approximateTerrainHeights.json +1 -0
- package/dist/Cesium/Cesium.js +14464 -0
- package/dist/Cesium/ThirdParty/Workers/basis_transcoder.js +31 -0
- package/dist/Cesium/ThirdParty/Workers/draco_decoder_nodejs.js +1 -0
- package/dist/Cesium/ThirdParty/Workers/package.js +1 -0
- package/dist/Cesium/ThirdParty/Workers/package.json +1 -0
- package/dist/Cesium/ThirdParty/Workers/pako_deflate.min.js +1 -0
- package/dist/Cesium/ThirdParty/Workers/pako_inflate.min.js +1 -0
- package/dist/Cesium/ThirdParty/Workers/z-worker-pako.js +1 -0
- package/dist/Cesium/ThirdParty/basis_transcoder.wasm +0 -0
- package/dist/Cesium/ThirdParty/draco_decoder.wasm +0 -0
- package/dist/Cesium/ThirdParty/google-earth-dbroot-parser.js +1 -0
- package/dist/Cesium/Widgets/Animation/Animation.css +127 -0
- package/dist/Cesium/Widgets/Animation/lighter.css +70 -0
- package/dist/Cesium/Widgets/BaseLayerPicker/BaseLayerPicker.css +108 -0
- package/dist/Cesium/Widgets/BaseLayerPicker/lighter.css +22 -0
- package/dist/Cesium/Widgets/Cesium3DTilesInspector/Cesium3DTilesInspector.css +102 -0
- package/dist/Cesium/Widgets/CesiumInspector/CesiumInspector.css +113 -0
- package/dist/Cesium/Widgets/CesiumWidget/CesiumWidget.css +124 -0
- package/dist/Cesium/Widgets/CesiumWidget/lighter.css +14 -0
- package/dist/Cesium/Widgets/FullscreenButton/FullscreenButton.css +8 -0
- package/dist/Cesium/Widgets/Geocoder/Geocoder.css +70 -0
- package/dist/Cesium/Widgets/Geocoder/lighter.css +17 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingAerial.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingAerialLabels.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/bingRoads.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/blueMarble.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/earthAtNight.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/esriNationalGeographic.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/esriWorldImagery.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/esriWorldStreetMap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapQuestOpenStreetMap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxSatellite.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxStreets.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/mapboxTerrain.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/naturalEarthII.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/openStreetMap.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/sentinel-2.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stamenToner.png +0 -0
- package/dist/Cesium/Widgets/Images/ImageryProviders/stamenWatercolor.png +0 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/Mouse.svg +84 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseLeft.svg +76 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseMiddle.svg +76 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/MouseRight.svg +76 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/Touch.svg +120 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchDrag.svg +129 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchRotate.svg +76 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchTilt.svg +135 -0
- package/dist/Cesium/Widgets/Images/NavigationHelp/TouchZoom.svg +74 -0
- package/dist/Cesium/Widgets/Images/TerrainProviders/CesiumWorldTerrain.png +0 -0
- package/dist/Cesium/Widgets/Images/TerrainProviders/Ellipsoid.png +0 -0
- package/dist/Cesium/Widgets/Images/TimelineIcons.png +0 -0
- package/dist/Cesium/Widgets/Images/info-loading.gif +0 -0
- package/dist/Cesium/Widgets/InfoBox/InfoBox.css +92 -0
- package/dist/Cesium/Widgets/InfoBox/InfoBoxDescription.css +178 -0
- package/dist/Cesium/Widgets/NavigationHelpButton/NavigationHelpButton.css +93 -0
- package/dist/Cesium/Widgets/NavigationHelpButton/lighter.css +38 -0
- package/dist/Cesium/Widgets/PerformanceWatchdog/PerformanceWatchdog.css +15 -0
- package/dist/Cesium/Widgets/ProjectionPicker/ProjectionPicker.css +38 -0
- package/dist/Cesium/Widgets/SceneModePicker/SceneModePicker.css +56 -0
- package/dist/Cesium/Widgets/SelectionIndicator/SelectionIndicator.css +20 -0
- package/dist/Cesium/Widgets/Timeline/Timeline.css +96 -0
- package/dist/Cesium/Widgets/Timeline/lighter.css +18 -0
- package/dist/Cesium/Widgets/VRButton/VRButton.css +8 -0
- package/dist/Cesium/Widgets/Viewer/Viewer.css +107 -0
- package/dist/Cesium/Widgets/VoxelInspector/VoxelInspector.css +16 -0
- package/dist/Cesium/Widgets/lighter.css +232 -0
- package/dist/Cesium/Widgets/lighterShared.css +46 -0
- package/dist/Cesium/Widgets/shared.css +103 -0
- package/dist/Cesium/Widgets/widgets.css +1311 -0
- package/dist/Cesium/Workers/ArcType-26a3f38d.js +1 -0
- package/dist/Cesium/Workers/AttributeCompression-48e336db.js +1 -0
- package/dist/Cesium/Workers/AxisAlignedBoundingBox-39ab50d0.js +1 -0
- package/dist/Cesium/Workers/BoundingRectangle-2379df5a.js +1 -0
- package/dist/Cesium/Workers/BoxGeometry-61fa3148.js +1 -0
- package/dist/Cesium/Workers/Color-7d827393.js +1 -0
- package/dist/Cesium/Workers/ComponentDatatype-ab629b88.js +1 -0
- package/dist/Cesium/Workers/CoplanarPolygonGeometryLibrary-9cff5a6c.js +1 -0
- package/dist/Cesium/Workers/CorridorGeometryLibrary-28996bf3.js +1 -0
- package/dist/Cesium/Workers/CylinderGeometry-966ff1e5.js +1 -0
- package/dist/Cesium/Workers/CylinderGeometryLibrary-f49f33a8.js +1 -0
- package/dist/Cesium/Workers/EllipseGeometry-fddb3596.js +1 -0
- package/dist/Cesium/Workers/EllipseGeometryLibrary-08d055cc.js +1 -0
- package/dist/Cesium/Workers/EllipseOutlineGeometry-a72d7da8.js +1 -0
- package/dist/Cesium/Workers/EllipsoidGeodesic-2723ab86.js +1 -0
- package/dist/Cesium/Workers/EllipsoidGeometry-fd18adbd.js +1 -0
- package/dist/Cesium/Workers/EllipsoidOutlineGeometry-d9d02643.js +1 -0
- package/dist/Cesium/Workers/EllipsoidRhumbLine-77eff028.js +1 -0
- package/dist/Cesium/Workers/EllipsoidTangentPlane-82f2a887.js +1 -0
- package/dist/Cesium/Workers/EncodedCartesian3-5e2017ab.js +1 -0
- package/dist/Cesium/Workers/FrustumGeometry-9378eccf.js +1 -0
- package/dist/Cesium/Workers/GeometryAttribute-81ff775c.js +1 -0
- package/dist/Cesium/Workers/GeometryAttributes-1e4ddcd2.js +1 -0
- package/dist/Cesium/Workers/GeometryInstance-0318e0cd.js +1 -0
- package/dist/Cesium/Workers/GeometryOffsetAttribute-2579b8d2.js +1 -0
- package/dist/Cesium/Workers/GeometryPipeline-e049e700.js +1 -0
- package/dist/Cesium/Workers/IndexDatatype-d3db4e7d.js +1 -0
- package/dist/Cesium/Workers/IntersectionTests-357c3d7f.js +1 -0
- package/dist/Cesium/Workers/Math-2ce22ee9.js +1 -0
- package/dist/Cesium/Workers/Matrix2-413c4048.js +1 -0
- package/dist/Cesium/Workers/Matrix3-81054f0f.js +1 -0
- package/dist/Cesium/Workers/OrientedBoundingBox-cfd17917.js +1 -0
- package/dist/Cesium/Workers/Plane-6add0ae1.js +1 -0
- package/dist/Cesium/Workers/PolygonGeometryLibrary-003d1689.js +1 -0
- package/dist/Cesium/Workers/PolygonPipeline-61ca1579.js +1 -0
- package/dist/Cesium/Workers/PolylinePipeline-8495667b.js +1 -0
- package/dist/Cesium/Workers/PolylineVolumeGeometryLibrary-2df3f067.js +1 -0
- package/dist/Cesium/Workers/PrimitivePipeline-8033b34b.js +1 -0
- package/dist/Cesium/Workers/RectangleGeometryLibrary-a0a06d23.js +1 -0
- package/dist/Cesium/Workers/RuntimeError-9b4ce3fb.js +1 -0
- package/dist/Cesium/Workers/TerrainEncoding-bd5c9ed5.js +1 -0
- package/dist/Cesium/Workers/Transforms-fce95115.js +14 -0
- package/dist/Cesium/Workers/VertexFormat-fbdec922.js +1 -0
- package/dist/Cesium/Workers/WallGeometryLibrary-1c767084.js +1 -0
- package/dist/Cesium/Workers/WebGLConstants-7f557f93.js +1 -0
- package/dist/Cesium/Workers/WebMercatorProjection-943e2226.js +1 -0
- package/dist/Cesium/Workers/arrayRemoveDuplicates-9b636830.js +1 -0
- package/dist/Cesium/Workers/cesiumWorkerBootstrapper.js +31 -0
- package/dist/Cesium/Workers/combine-0c102d93.js +1 -0
- package/dist/Cesium/Workers/combineGeometry.js +1 -0
- package/dist/Cesium/Workers/createBoxGeometry.js +1 -0
- package/dist/Cesium/Workers/createBoxOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createCircleGeometry.js +1 -0
- package/dist/Cesium/Workers/createCircleOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createCoplanarPolygonGeometry.js +1 -0
- package/dist/Cesium/Workers/createCoplanarPolygonOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createCorridorGeometry.js +1 -0
- package/dist/Cesium/Workers/createCorridorOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createCylinderGeometry.js +1 -0
- package/dist/Cesium/Workers/createCylinderOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createEllipseGeometry.js +1 -0
- package/dist/Cesium/Workers/createEllipseOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createEllipsoidGeometry.js +1 -0
- package/dist/Cesium/Workers/createEllipsoidOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createFrustumGeometry.js +1 -0
- package/dist/Cesium/Workers/createFrustumOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createGeometry.js +1 -0
- package/dist/Cesium/Workers/createGroundPolylineGeometry.js +1 -0
- package/dist/Cesium/Workers/createPlaneGeometry.js +1 -0
- package/dist/Cesium/Workers/createPlaneOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createPolygonGeometry.js +1 -0
- package/dist/Cesium/Workers/createPolygonOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createPolylineGeometry.js +1 -0
- package/dist/Cesium/Workers/createPolylineVolumeGeometry.js +1 -0
- package/dist/Cesium/Workers/createPolylineVolumeOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createRectangleGeometry.js +1 -0
- package/dist/Cesium/Workers/createRectangleOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createSimplePolylineGeometry.js +1 -0
- package/dist/Cesium/Workers/createSphereGeometry.js +1 -0
- package/dist/Cesium/Workers/createSphereOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/createTaskProcessorWorker.js +1 -0
- package/dist/Cesium/Workers/createVectorTileClampedPolylines.js +1 -0
- package/dist/Cesium/Workers/createVectorTileGeometries.js +1 -0
- package/dist/Cesium/Workers/createVectorTilePoints.js +1 -0
- package/dist/Cesium/Workers/createVectorTilePolygons.js +1 -0
- package/dist/Cesium/Workers/createVectorTilePolylines.js +1 -0
- package/dist/Cesium/Workers/createVerticesFromGoogleEarthEnterpriseBuffer.js +1 -0
- package/dist/Cesium/Workers/createVerticesFromHeightmap.js +3 -0
- package/dist/Cesium/Workers/createVerticesFromQuantizedTerrainMesh.js +1 -0
- package/dist/Cesium/Workers/createWallGeometry.js +1 -0
- package/dist/Cesium/Workers/createWallOutlineGeometry.js +1 -0
- package/dist/Cesium/Workers/decodeDraco.js +1 -0
- package/dist/Cesium/Workers/decodeGoogleEarthEnterprisePacket.js +1 -0
- package/dist/Cesium/Workers/decodeI3S.js +1 -0
- package/dist/Cesium/Workers/defaultValue-f6d5e6da.js +1 -0
- package/dist/Cesium/Workers/package.js +26 -0
- package/dist/Cesium/Workers/transcodeKTX2.js +1 -0
- package/dist/Cesium/Workers/transferTypedArrayTest.js +26 -0
- package/dist/Cesium/Workers/upsampleQuantizedTerrainMesh.js +1 -0
- package/dist/Cesium/index.cjs +14464 -0
- package/dist/Cesium/index.js +14464 -0
- package/dist/autocomplete/autocomplete.d.ts +32 -33
- package/dist/autocomplete/index.d.ts +1 -1
- package/dist/box/box.d.ts +3 -3
- package/dist/box/index.d.ts +1 -1
- package/dist/cesium-map/data-sources/custom.data-source.d.ts +5 -5
- package/dist/cesium-map/data-sources/drawings.data-source.d.ts +34 -34
- package/dist/cesium-map/data-sources/index.d.ts +2 -2
- package/dist/cesium-map/entities/entity.d.ts +5 -5
- package/dist/cesium-map/entities/entity.description.d.ts +8 -6
- package/dist/cesium-map/entities/graphics/polygon.graphics.d.ts +5 -5
- package/dist/cesium-map/entities/graphics/polyline.graphics.d.ts +5 -5
- package/dist/cesium-map/entities/graphics/rectangle.graphics.d.ts +5 -5
- package/dist/cesium-map/entities/index.d.ts +4 -4
- package/dist/cesium-map/helpers/customImageryProviders.d.ts +34 -34
- package/dist/cesium-map/helpers/utils.d.ts +17 -17
- package/dist/cesium-map/index.d.ts +8 -8
- package/dist/cesium-map/layers/3d.tileset.d.ts +7 -7
- package/dist/cesium-map/layers/geojson.layer.d.ts +5 -5
- package/dist/cesium-map/layers/imagery.layer.d.ts +6 -6
- package/dist/cesium-map/layers/index.d.ts +7 -7
- package/dist/cesium-map/layers/osm.layer.d.ts +9 -9
- package/dist/cesium-map/layers/wms.layer.d.ts +9 -9
- package/dist/cesium-map/layers/wmts.layer.d.ts +9 -9
- package/dist/cesium-map/layers/xyz.layer.d.ts +9 -9
- package/dist/cesium-map/layers-manager.d.ts +59 -59
- package/dist/cesium-map/map-legend/MapLegend.d.ts +14 -15
- package/dist/cesium-map/map-legend/MapLegendList.d.ts +12 -13
- package/dist/cesium-map/map-legend/MapLegendSidebar.d.ts +15 -16
- package/dist/cesium-map/map-legend/MapLegendToggle.d.ts +6 -7
- package/dist/cesium-map/map-legend/index.d.ts +3 -3
- package/dist/cesium-map/map.d.ts +69 -68
- package/dist/cesium-map/map.types.d.ts +8 -8
- package/dist/cesium-map/proxied.types.d.ts +30 -30
- package/dist/cesium-map/settings/base-maps.d.ts +6 -7
- package/dist/cesium-map/settings/scene-modes.d.ts +6 -7
- package/dist/cesium-map/settings/settings.d.ts +22 -23
- package/dist/cesium-map/tools/cesium/primitives-conversions.cesium.d.ts +2 -2
- package/dist/cesium-map/tools/coordinates-tracker.tool.d.ts +6 -7
- package/dist/cesium-map/tools/draw/drawHelper.d.ts +27 -28
- package/dist/cesium-map/tools/geojson/geojson-to-primitive.d.ts +4 -4
- package/dist/cesium-map/tools/geojson/index.d.ts +2 -2
- package/dist/cesium-map/tools/geojson/point.geojson.d.ts +7 -7
- package/dist/cesium-map/tools/geojson/polygon.geojson.d.ts +3 -3
- package/dist/cesium-map/tools/geojson/rectangle.geojson.d.ts +3 -3
- package/dist/cesium-map/tools/scale-tracker.tool.d.ts +7 -8
- package/dist/cesium-map/tools/zoom_level-tracker.tool.d.ts +7 -8
- package/dist/cssbaseline/cssbaseline.d.ts +5 -5
- package/dist/cssbaseline/index.d.ts +1 -1
- package/dist/date-picker/date-picker.d.ts +12 -14
- package/dist/date-picker/index.d.ts +1 -1
- package/dist/date-range-picker/date-range-picker.d.ts +24 -26
- package/dist/date-range-picker/date-range-picker.form-control.d.ts +26 -28
- package/dist/date-range-picker/index.d.ts +2 -2
- package/dist/file-picker/file-picker.d.ts +275 -276
- package/dist/file-picker/index.d.ts +2 -2
- package/dist/file-picker/localization.d.ts +11 -11
- package/dist/fonts/material-icons/MaterialIcons-Regular.eot +0 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.ijmap +1 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.svg +2373 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.ttf +0 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.woff +0 -0
- package/dist/fonts/material-icons/MaterialIcons-Regular.woff2 +0 -0
- package/dist/fonts/material-icons/README.md +9 -0
- package/dist/fonts/material-icons/codepoints +932 -0
- package/dist/fonts/material-icons/material-icons.css +36 -0
- package/dist/index.d.ts +12 -13
- package/dist/map-filter-container/container-map.d.ts +10 -11
- package/dist/map-filter-container/index.d.ts +1 -1
- package/dist/map-filter-container/map-filter-container.d.ts +9 -9
- package/dist/map-filter-container/polygon-selection-ui.d.ts +9 -12
- package/dist/models/defaults.d.ts +28 -28
- package/dist/models/enums.d.ts +14 -14
- package/dist/models/index.d.ts +1 -1
- package/dist/ol-map/feature.d.ts +6 -6
- package/dist/ol-map/interactions/draw.d.ts +8 -8
- package/dist/ol-map/layers/tile-layer.d.ts +9 -9
- package/dist/ol-map/layers/vector-layer.d.ts +4 -4
- package/dist/ol-map/map.d.ts +12 -14
- package/dist/ol-map/source/osm.d.ts +2 -2
- package/dist/ol-map/source/vector-source.d.ts +4 -4
- package/dist/popover/index.d.ts +1 -1
- package/dist/popover/popover.d.ts +3 -3
- package/dist/smart-table/index.d.ts +2 -2
- package/dist/smart-table/smart-table-head.d.ts +11 -11
- package/dist/smart-table/smart-table-row.d.ts +13 -12
- package/dist/smart-table/smart-table-types.d.ts +9 -9
- package/dist/smart-table/smart-table.d.ts +17 -17
- package/dist/theme/index.d.ts +1 -1
- package/dist/theme/theme.d.ts +9 -8
- package/dist/utils/map.d.ts +3 -3
- package/dist/utils/projections.d.ts +6 -6
- package/package.json +41 -71
- package/.env +0 -1
- package/.eslintignore +0 -2
- package/.storybook/main.js +0 -13
- package/.storybook/manager.js +0 -6
- package/.storybook/preview-head.html +0 -21
- package/.storybook/preview.js +0 -18
- package/.storybook/theme.js +0 -9
- package/CHANGELOG.md +0 -909
- package/README.md +0 -53
- package/dist/assets/img/dragIcon.png +0 -0
- package/dist/assets/img/dragIconLight.png +0 -0
- package/dist/assets/img/glyphicons_067_cleaning.png +0 -0
- package/dist/assets/img/glyphicons_094_vector_path_square.png +0 -0
- package/dist/assets/img/glyphicons_095_vector_path_circle.png +0 -0
- package/dist/assets/img/glyphicons_096_vector_path_polygon.png +0 -0
- package/dist/assets/img/glyphicons_097_vector_path_line.png +0 -0
- package/dist/assets/img/glyphicons_242_google_maps.png +0 -0
- package/dist/assets/img/map-marker.gif +0 -0
- package/dist/assets/img/transparent-tile.png +0 -0
- package/dist/autocomplete/autocomplete.js +0 -478
- package/dist/autocomplete/index.js +0 -5
- package/dist/box/box.js +0 -35
- package/dist/box/index.js +0 -5
- package/dist/cesium-map/data-sources/custom.data-source.js +0 -23
- package/dist/cesium-map/data-sources/drawings.data-source.js +0 -193
- package/dist/cesium-map/data-sources/index.js +0 -14
- package/dist/cesium-map/entities/entity.description.js +0 -27
- package/dist/cesium-map/entities/entity.js +0 -23
- package/dist/cesium-map/entities/graphics/polygon.graphics.js +0 -23
- package/dist/cesium-map/entities/graphics/polyline.graphics.js +0 -23
- package/dist/cesium-map/entities/graphics/rectangle.graphics.js +0 -23
- package/dist/cesium-map/entities/index.js +0 -16
- package/dist/cesium-map/helpers/customImageryProviders.js +0 -106
- package/dist/cesium-map/helpers/utils.js +0 -142
- package/dist/cesium-map/index.js +0 -20
- package/dist/cesium-map/layers/3d.tileset.js +0 -43
- package/dist/cesium-map/layers/3d.tileset.with.update.d.ts +0 -6
- package/dist/cesium-map/layers/3d.tileset.with.update.js +0 -115
- package/dist/cesium-map/layers/geojson.layer.js +0 -23
- package/dist/cesium-map/layers/imagery.layer.js +0 -68
- package/dist/cesium-map/layers/index.js +0 -19
- package/dist/cesium-map/layers/osm.layer.js +0 -36
- package/dist/cesium-map/layers/wms.layer.js +0 -42
- package/dist/cesium-map/layers/wmts.layer.js +0 -42
- package/dist/cesium-map/layers/xyz.layer.js +0 -42
- package/dist/cesium-map/layers-manager.js +0 -403
- package/dist/cesium-map/map-legend/MapLegend.js +0 -57
- package/dist/cesium-map/map-legend/MapLegendList.js +0 -43
- package/dist/cesium-map/map-legend/MapLegendSidebar.js +0 -20
- package/dist/cesium-map/map-legend/MapLegendToggle.js +0 -20
- package/dist/cesium-map/map-legend/index.js +0 -14
- package/dist/cesium-map/map.js +0 -339
- package/dist/cesium-map/map.types.js +0 -12
- package/dist/cesium-map/proxied.types.js +0 -133
- package/dist/cesium-map/settings/base-maps.js +0 -78
- package/dist/cesium-map/settings/scene-modes.js +0 -65
- package/dist/cesium-map/settings/settings.js +0 -79
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.d.ts +0 -3
- package/dist/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.js +0 -245
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.d.ts +0 -9
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-decoder.js +0 -202
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.d.ts +0 -50
- package/dist/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.js +0 -136
- package/dist/cesium-map/tools/cesium/primitives-conversions.cesium.js +0 -38
- package/dist/cesium-map/tools/coordinates-tracker.tool.js +0 -82
- package/dist/cesium-map/tools/draw/drawHelper.js +0 -1694
- package/dist/cesium-map/tools/geojson/geojson-to-primitive.js +0 -41
- package/dist/cesium-map/tools/geojson/index.js +0 -14
- package/dist/cesium-map/tools/geojson/point.geojson.js +0 -43
- package/dist/cesium-map/tools/geojson/polygon.geojson.js +0 -24
- package/dist/cesium-map/tools/geojson/rectangle.geojson.js +0 -44
- package/dist/cesium-map/tools/inspector.tool.d.ts +0 -4
- package/dist/cesium-map/tools/inspector.tool.js +0 -33
- package/dist/cesium-map/tools/scale-tracker.tool.js +0 -161
- package/dist/cesium-map/tools/terranian-height.tool.d.ts +0 -4
- package/dist/cesium-map/tools/terranian-height.tool.js +0 -114
- package/dist/cesium-map/tools/zoom_level-tracker.tool.js +0 -134
- package/dist/cssbaseline/cssbaseline.js +0 -41
- package/dist/cssbaseline/index.js +0 -6
- package/dist/date-picker/date-picker.js +0 -78
- package/dist/date-picker/index.js +0 -13
- package/dist/date-range-picker/date-range-picker.form-control.js +0 -95
- package/dist/date-range-picker/date-range-picker.js +0 -104
- package/dist/date-range-picker/index.js +0 -14
- package/dist/file-picker/file-picker.js +0 -151
- package/dist/file-picker/index.js +0 -14
- package/dist/file-picker/localization.js +0 -124
- package/dist/index.js +0 -25
- package/dist/map-filter-container/container-map.js +0 -31
- package/dist/map-filter-container/index.js +0 -13
- package/dist/map-filter-container/map-filter-container.js +0 -78
- package/dist/map-filter-container/polygon-selection-ui.js +0 -62
- package/dist/models/defaults.js +0 -32
- package/dist/models/enums.js +0 -20
- package/dist/models/index.js +0 -13
- package/dist/ol-map/feature.js +0 -20
- package/dist/ol-map/index.d.ts +0 -6
- package/dist/ol-map/index.js +0 -18
- package/dist/ol-map/interactions/draw.js +0 -44
- package/dist/ol-map/interactions/index.d.ts +0 -1
- package/dist/ol-map/interactions/index.js +0 -13
- package/dist/ol-map/layers/index.d.ts +0 -3
- package/dist/ol-map/layers/index.js +0 -15
- package/dist/ol-map/layers/tile-layer.js +0 -48
- package/dist/ol-map/layers/vector-layer.js +0 -48
- package/dist/ol-map/layers/vector-tile-layer.d.ts +0 -10
- package/dist/ol-map/layers/vector-tile-layer.js +0 -66
- package/dist/ol-map/map.js +0 -117
- package/dist/ol-map/source/index.d.ts +0 -6
- package/dist/ol-map/source/index.js +0 -18
- package/dist/ol-map/source/mvt.d.ts +0 -11
- package/dist/ol-map/source/mvt.js +0 -37
- package/dist/ol-map/source/osm.js +0 -14
- package/dist/ol-map/source/vector-source.js +0 -45
- package/dist/ol-map/source/wms.d.ts +0 -17
- package/dist/ol-map/source/wms.js +0 -30
- package/dist/ol-map/source/wmts.d.ts +0 -21
- package/dist/ol-map/source/wmts.js +0 -59
- package/dist/ol-map/source/xyz.d.ts +0 -12
- package/dist/ol-map/source/xyz.js +0 -27
- package/dist/ol-map/style.d.ts +0 -4
- package/dist/ol-map/style.js +0 -22
- package/dist/popover/index.js +0 -5
- package/dist/popover/popover.js +0 -35
- package/dist/smart-table/__mock-data__/smartTableMocks.d.ts +0 -7
- package/dist/smart-table/__mock-data__/smartTableMocks.js +0 -17
- package/dist/smart-table/index.js +0 -14
- package/dist/smart-table/smart-table-head.js +0 -22
- package/dist/smart-table/smart-table-row.js +0 -46
- package/dist/smart-table/smart-table-types.js +0 -2
- package/dist/smart-table/smart-table.js +0 -51
- package/dist/theme/index.js +0 -13
- package/dist/theme/theme.js +0 -124
- package/dist/utils/map.js +0 -21
- package/dist/utils/projections.js +0 -10
- package/dist/utils/story.d.ts +0 -12
- package/dist/utils/story.js +0 -2
- package/public/assets/img/dragIcon.png +0 -0
- package/public/assets/img/dragIconLight.png +0 -0
- package/public/assets/img/glyphicons_067_cleaning.png +0 -0
- package/public/assets/img/glyphicons_094_vector_path_square.png +0 -0
- package/public/assets/img/glyphicons_095_vector_path_circle.png +0 -0
- package/public/assets/img/glyphicons_096_vector_path_polygon.png +0 -0
- package/public/assets/img/glyphicons_097_vector_path_line.png +0 -0
- package/public/assets/img/glyphicons_242_google_maps.png +0 -0
- package/public/assets/img/map-marker.gif +0 -0
- package/public/assets/img/transparent-tile.png +0 -0
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -43
- package/public/logo192.png +0 -0
- package/public/logo512.png +0 -0
- package/public/manifest.json +0 -25
- package/public/robots.txt +0 -3
- package/src/index.tsx +0 -9
- package/src/lib/autocomplete/autocomplete.css +0 -25
- package/src/lib/autocomplete/autocomplete.stories.tsx +0 -101
- package/src/lib/autocomplete/autocomplete.tsx +0 -681
- package/src/lib/autocomplete/get-input-selection.d.ts +0 -1
- package/src/lib/autocomplete/index.ts +0 -1
- package/src/lib/box/box.tsx +0 -7
- package/src/lib/box/index.ts +0 -1
- package/src/lib/cesium-map/context-menu.stories.tsx +0 -444
- package/src/lib/cesium-map/data-sources/custom.data-source.tsx +0 -12
- package/src/lib/cesium-map/data-sources/drawings.data-source.stories.tsx +0 -161
- package/src/lib/cesium-map/data-sources/drawings.data-source.tsx +0 -213
- package/src/lib/cesium-map/data-sources/index.ts +0 -2
- package/src/lib/cesium-map/entities/entity.description.tsx +0 -19
- package/src/lib/cesium-map/entities/entity.graphics.stories.tsx +0 -48
- package/src/lib/cesium-map/entities/entity.stories.tsx +0 -146
- package/src/lib/cesium-map/entities/entity.tsx +0 -10
- package/src/lib/cesium-map/entities/graphics/polygon.graphics.tsx +0 -12
- package/src/lib/cesium-map/entities/graphics/polyline.graphics.tsx +0 -12
- package/src/lib/cesium-map/entities/graphics/rectangle.graphics.tsx +0 -12
- package/src/lib/cesium-map/entities/index.ts +0 -4
- package/src/lib/cesium-map/helpers/customImageryProviders.ts +0 -173
- package/src/lib/cesium-map/helpers/utils.ts +0 -135
- package/src/lib/cesium-map/index.ts +0 -8
- package/src/lib/cesium-map/layers/3d.tileset.stories.tsx +0 -164
- package/src/lib/cesium-map/layers/3d.tileset.tsx +0 -51
- package/src/lib/cesium-map/layers/3d.tileset.with.update.tsx +0 -120
- package/src/lib/cesium-map/layers/geojson.layer.stories.tsx +0 -180
- package/src/lib/cesium-map/layers/geojson.layer.tsx +0 -12
- package/src/lib/cesium-map/layers/imagery.layer.stories.tsx +0 -39
- package/src/lib/cesium-map/layers/imagery.layer.tsx +0 -37
- package/src/lib/cesium-map/layers/index.ts +0 -7
- package/src/lib/cesium-map/layers/layers.rect.stories.tsx +0 -171
- package/src/lib/cesium-map/layers/optimized-tile-requests.stories.tsx +0 -279
- package/src/lib/cesium-map/layers/osm.layer.stories.tsx +0 -40
- package/src/lib/cesium-map/layers/osm.layer.tsx +0 -22
- package/src/lib/cesium-map/layers/wms.layer.stories.tsx +0 -38
- package/src/lib/cesium-map/layers/wms.layer.tsx +0 -28
- package/src/lib/cesium-map/layers/wmts.layer.stories.tsx +0 -53
- package/src/lib/cesium-map/layers/wmts.layer.tsx +0 -27
- package/src/lib/cesium-map/layers/xyz.layer.stories.tsx +0 -37
- package/src/lib/cesium-map/layers/xyz.layer.tsx +0 -27
- package/src/lib/cesium-map/layers-manager.stories.tsx +0 -286
- package/src/lib/cesium-map/layers-manager.ts +0 -558
- package/src/lib/cesium-map/map-legend/MapLegend.css +0 -136
- package/src/lib/cesium-map/map-legend/MapLegend.tsx +0 -92
- package/src/lib/cesium-map/map-legend/MapLegendList.tsx +0 -47
- package/src/lib/cesium-map/map-legend/MapLegendSidebar.tsx +0 -55
- package/src/lib/cesium-map/map-legend/MapLegendToggle.tsx +0 -31
- package/src/lib/cesium-map/map-legend/index.tsx +0 -3
- package/src/lib/cesium-map/map-legend/legends-sidebar.stories.tsx +0 -201
- package/src/lib/cesium-map/map.css +0 -59
- package/src/lib/cesium-map/map.stories.tsx +0 -144
- package/src/lib/cesium-map/map.tsx +0 -492
- package/src/lib/cesium-map/map.types.ts +0 -11
- package/src/lib/cesium-map/proxied.types.ts +0 -58
- package/src/lib/cesium-map/settings/base-maps.css +0 -37
- package/src/lib/cesium-map/settings/base-maps.tsx +0 -94
- package/src/lib/cesium-map/settings/scene-modes.css +0 -19
- package/src/lib/cesium-map/settings/scene-modes.tsx +0 -100
- package/src/lib/cesium-map/settings/settings.css +0 -52
- package/src/lib/cesium-map/settings/settings.stories.tsx +0 -186
- package/src/lib/cesium-map/settings/settings.tsx +0 -141
- package/src/lib/cesium-map/terrain-providers/custom/dummy-quantized-mesh-tile.ts +0 -243
- package/src/lib/cesium-map/terrain-providers/custom/quantized-mesh-decoder.ts +0 -321
- package/src/lib/cesium-map/terrain-providers/custom/quantized-mesh-terrain-provider.ts +0 -237
- package/src/lib/cesium-map/terrain-providers/terrain-provider-heights-tool.stories.tsx +0 -170
- package/src/lib/cesium-map/terrain-providers/terrain-provider.stories.tsx +0 -187
- package/src/lib/cesium-map/tools/cesium/primitives-conversions.cesium.ts +0 -15
- package/src/lib/cesium-map/tools/coordinates-tracker.tool.css +0 -11
- package/src/lib/cesium-map/tools/coordinates-tracker.tool.tsx +0 -85
- package/src/lib/cesium-map/tools/draw/drawHelper.css +0 -101
- package/src/lib/cesium-map/tools/draw/drawHelper.ts +0 -2116
- package/src/lib/cesium-map/tools/geojson/geojson-to-primitive.ts +0 -54
- package/src/lib/cesium-map/tools/geojson/index.ts +0 -2
- package/src/lib/cesium-map/tools/geojson/point.geojson.ts +0 -63
- package/src/lib/cesium-map/tools/geojson/polygon.geojson.ts +0 -24
- package/src/lib/cesium-map/tools/geojson/rectangle.geojson.ts +0 -21
- package/src/lib/cesium-map/tools/inspector.tool.tsx +0 -15
- package/src/lib/cesium-map/tools/scale-tracker.tool.css +0 -16
- package/src/lib/cesium-map/tools/scale-tracker.tool.tsx +0 -195
- package/src/lib/cesium-map/tools/terranian-height.tool.tsx +0 -171
- package/src/lib/cesium-map/tools/zoom_level-tracker.tool.css +0 -19
- package/src/lib/cesium-map/tools/zoom_level-tracker.tool.tsx +0 -144
- package/src/lib/cssbaseline/cssbaseline.tsx +0 -19
- package/src/lib/cssbaseline/index.ts +0 -4
- package/src/lib/date-picker/date-picker.css +0 -9
- package/src/lib/date-picker/date-picker.stories.tsx +0 -130
- package/src/lib/date-picker/date-picker.tsx +0 -90
- package/src/lib/date-picker/index.ts +0 -1
- package/src/lib/date-range-picker/date-range-picker.css +0 -9
- package/src/lib/date-range-picker/date-range-picker.form-control.css +0 -3
- package/src/lib/date-range-picker/date-range-picker.form-control.spec.tsx +0 -58
- package/src/lib/date-range-picker/date-range-picker.form-control.tsx +0 -150
- package/src/lib/date-range-picker/date-range-picker.spec.tsx +0 -81
- package/src/lib/date-range-picker/date-range-picker.stories.tsx +0 -207
- package/src/lib/date-range-picker/date-range-picker.tsx +0 -156
- package/src/lib/date-range-picker/index.ts +0 -2
- package/src/lib/file-picker/file-picker.css +0 -63
- package/src/lib/file-picker/file-picker.stories.tsx +0 -447
- package/src/lib/file-picker/file-picker.tsx +0 -180
- package/src/lib/file-picker/fs-map.json +0 -1557
- package/src/lib/file-picker/index.ts +0 -2
- package/src/lib/file-picker/localization.ts +0 -164
- package/src/lib/index.ts +0 -13
- package/src/lib/map-filter-container/container-map.css +0 -5
- package/src/lib/map-filter-container/container-map.tsx +0 -48
- package/src/lib/map-filter-container/index.ts +0 -1
- package/src/lib/map-filter-container/map-filter-container.tsx +0 -91
- package/src/lib/map-filter-container/polygon-selection-ui.spec.tsx +0 -119
- package/src/lib/map-filter-container/polygon-selection-ui.tsx +0 -111
- package/src/lib/map-filter-container/stories/Map.stories.tsx +0 -76
- package/src/lib/models/defaults.ts +0 -32
- package/src/lib/models/enums.ts +0 -16
- package/src/lib/models/index.ts +0 -1
- package/src/lib/ol-map/feature.tsx +0 -23
- package/src/lib/ol-map/index.ts +0 -6
- package/src/lib/ol-map/interactions/draw.tsx +0 -56
- package/src/lib/ol-map/interactions/index.ts +0 -1
- package/src/lib/ol-map/layers/index.ts +0 -3
- package/src/lib/ol-map/layers/tile-layer.tsx +0 -36
- package/src/lib/ol-map/layers/vector-layer.tsx +0 -32
- package/src/lib/ol-map/layers/vector-tile-layer.tsx +0 -56
- package/src/lib/ol-map/map.css +0 -17
- package/src/lib/ol-map/map.tsx +0 -137
- package/src/lib/ol-map/source/index.ts +0 -6
- package/src/lib/ol-map/source/mvt.tsx +0 -46
- package/src/lib/ol-map/source/osm.tsx +0 -13
- package/src/lib/ol-map/source/stories/mvt.stories.tsx +0 -68
- package/src/lib/ol-map/source/stories/vector-source.stories.tsx +0 -78
- package/src/lib/ol-map/source/stories/wms.stories.tsx +0 -51
- package/src/lib/ol-map/source/stories/wmts.stories.tsx +0 -72
- package/src/lib/ol-map/source/stories/xyz.stories.tsx +0 -53
- package/src/lib/ol-map/source/vector-source.tsx +0 -30
- package/src/lib/ol-map/source/wms.tsx +0 -40
- package/src/lib/ol-map/source/wmts.tsx +0 -82
- package/src/lib/ol-map/source/xyz.tsx +0 -33
- package/src/lib/ol-map/stories/map.stories.tsx +0 -60
- package/src/lib/ol-map/style.ts +0 -24
- package/src/lib/popover/index.ts +0 -1
- package/src/lib/popover/popover.tsx +0 -7
- package/src/lib/smart-table/__mock-data__/smartTableMocks.ts +0 -22
- package/src/lib/smart-table/index.ts +0 -2
- package/src/lib/smart-table/smart-table-head.spec.tsx +0 -116
- package/src/lib/smart-table/smart-table-head.tsx +0 -47
- package/src/lib/smart-table/smart-table-row.spec.tsx +0 -109
- package/src/lib/smart-table/smart-table-row.tsx +0 -78
- package/src/lib/smart-table/smart-table-types.ts +0 -10
- package/src/lib/smart-table/smart-table.spec.tsx +0 -116
- package/src/lib/smart-table/smart-table.tsx +0 -115
- package/src/lib/smart-table/stories/SmartTable.stories.tsx +0 -114
- package/src/lib/theme/index.ts +0 -1
- package/src/lib/theme/theme.ts +0 -123
- package/src/lib/utils/map.ts +0 -19
- package/src/lib/utils/projections.ts +0 -7
- package/src/lib/utils/story.ts +0 -11
- package/src/react-app-env.d.ts +0 -1
- package/src/setupTests.ts +0 -14
- package/src/types/quantized-mesh-decoder.d.ts +0 -1
- package/tsbuildconfig.json +0 -37
- package/tsconfig.json +0 -26
|
@@ -1,2116 +0,0 @@
|
|
|
1
|
-
// inspired by https://github.com/leforthomas/cesium-drawhelper
|
|
2
|
-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
3
|
-
// @ts-nocheck
|
|
4
|
-
import * as Cesium from 'cesium';
|
|
5
|
-
import './drawHelper.css';
|
|
6
|
-
/* eslint-disable */
|
|
7
|
-
var DrawHelper = (function () {
|
|
8
|
-
// static variables
|
|
9
|
-
var ellipsoid = Cesium.Ellipsoid.WGS84;
|
|
10
|
-
var drawingVertexColor;
|
|
11
|
-
var material = Cesium.Material.fromType(Cesium.Material.ColorType);
|
|
12
|
-
|
|
13
|
-
// constructor
|
|
14
|
-
function _(
|
|
15
|
-
cesiumWidget,
|
|
16
|
-
materialClr = new Cesium.Color(1.0, 1.0, 0.0, 0.5),
|
|
17
|
-
drawingVertexClr = new Cesium.Color(1.0, 1.0, 1.0, 1.0)
|
|
18
|
-
) {
|
|
19
|
-
this._scene = cesiumWidget.scene;
|
|
20
|
-
|
|
21
|
-
// UPDATE scoped varibles
|
|
22
|
-
material.uniforms.color = materialClr;
|
|
23
|
-
drawingVertexColor = drawingVertexClr;
|
|
24
|
-
|
|
25
|
-
//MC_CHANGE disable/override tooltip
|
|
26
|
-
this._tooltip = {
|
|
27
|
-
setVisible: () => {},
|
|
28
|
-
showAt: () => {},
|
|
29
|
-
};
|
|
30
|
-
// this._tooltip = createTooltip(cesiumWidget.container);
|
|
31
|
-
this._surfaces = [];
|
|
32
|
-
|
|
33
|
-
this.initialiseHandlers();
|
|
34
|
-
|
|
35
|
-
this.enhancePrimitives();
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
_.prototype.initialiseHandlers = function () {
|
|
39
|
-
var scene = this._scene;
|
|
40
|
-
var _self = this;
|
|
41
|
-
// scene events
|
|
42
|
-
var handler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
43
|
-
function callPrimitiveCallback(name, position) {
|
|
44
|
-
if (_self._handlersMuted == true) return;
|
|
45
|
-
var pickedObject = scene.pick(position);
|
|
46
|
-
if (
|
|
47
|
-
pickedObject &&
|
|
48
|
-
pickedObject.primitive &&
|
|
49
|
-
pickedObject.primitive[name]
|
|
50
|
-
) {
|
|
51
|
-
pickedObject.primitive[name](position);
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
handler.setInputAction(function (movement) {
|
|
55
|
-
callPrimitiveCallback('leftClick', movement.position);
|
|
56
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
57
|
-
handler.setInputAction(function (movement) {
|
|
58
|
-
callPrimitiveCallback('leftDoubleClick', movement.position);
|
|
59
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
60
|
-
var mouseOutObject;
|
|
61
|
-
handler.setInputAction(function (movement) {
|
|
62
|
-
if (_self._handlersMuted == true) return;
|
|
63
|
-
var pickedObject = scene.pick(movement.endPosition);
|
|
64
|
-
if (
|
|
65
|
-
mouseOutObject &&
|
|
66
|
-
(!pickedObject || mouseOutObject != pickedObject.primitive)
|
|
67
|
-
) {
|
|
68
|
-
!(mouseOutObject.isDestroyed && mouseOutObject.isDestroyed()) &&
|
|
69
|
-
mouseOutObject.mouseOut(movement.endPosition);
|
|
70
|
-
mouseOutObject = null;
|
|
71
|
-
}
|
|
72
|
-
if (pickedObject && pickedObject.primitive) {
|
|
73
|
-
pickedObject = pickedObject.primitive;
|
|
74
|
-
if (pickedObject.mouseOut) {
|
|
75
|
-
mouseOutObject = pickedObject;
|
|
76
|
-
}
|
|
77
|
-
if (pickedObject.mouseMove) {
|
|
78
|
-
pickedObject.mouseMove(movement.endPosition);
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
82
|
-
handler.setInputAction(function (movement) {
|
|
83
|
-
callPrimitiveCallback('leftUp', movement.position);
|
|
84
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
85
|
-
handler.setInputAction(function (movement) {
|
|
86
|
-
callPrimitiveCallback('leftDown', movement.position);
|
|
87
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
_.prototype.setListener = function (primitive, type, callback) {
|
|
91
|
-
primitive[type] = callback;
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
_.prototype.muteHandlers = function (muted) {
|
|
95
|
-
this._handlersMuted = muted;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
// register event handling for an editable shape
|
|
99
|
-
// shape should implement setEditMode and setHighlighted
|
|
100
|
-
_.prototype.registerEditableShape = function (surface) {
|
|
101
|
-
var _self = this;
|
|
102
|
-
|
|
103
|
-
// handlers for interactions
|
|
104
|
-
// highlight polygon when mouse is entering
|
|
105
|
-
setListener(surface, 'mouseMove', function (position) {
|
|
106
|
-
surface.setHighlighted(true);
|
|
107
|
-
if (!surface._editMode) {
|
|
108
|
-
_self._tooltip.showAt(position, 'Click to edit this shape');
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
// hide the highlighting when mouse is leaving the polygon
|
|
112
|
-
setListener(surface, 'mouseOut', function (position) {
|
|
113
|
-
surface.setHighlighted(false);
|
|
114
|
-
_self._tooltip.setVisible(false);
|
|
115
|
-
});
|
|
116
|
-
setListener(surface, 'leftClick', function (position) {
|
|
117
|
-
surface.setEditMode(true);
|
|
118
|
-
});
|
|
119
|
-
};
|
|
120
|
-
|
|
121
|
-
_.prototype.startDrawing = function (cleanUp) {
|
|
122
|
-
// undo any current edit of shapes
|
|
123
|
-
this.disableAllEditMode();
|
|
124
|
-
// check for cleanUp first
|
|
125
|
-
if (this.editCleanUp) {
|
|
126
|
-
this.editCleanUp();
|
|
127
|
-
}
|
|
128
|
-
this.editCleanUp = cleanUp;
|
|
129
|
-
this.muteHandlers(true);
|
|
130
|
-
};
|
|
131
|
-
|
|
132
|
-
_.prototype.stopDrawing = function () {
|
|
133
|
-
// check for cleanUp first
|
|
134
|
-
if (this.editCleanUp) {
|
|
135
|
-
this.editCleanUp();
|
|
136
|
-
this.editCleanUp = null;
|
|
137
|
-
}
|
|
138
|
-
this.muteHandlers(false);
|
|
139
|
-
};
|
|
140
|
-
|
|
141
|
-
// make sure only one shape is highlighted at a time
|
|
142
|
-
_.prototype.disableAllHighlights = function () {
|
|
143
|
-
this.setHighlighted(undefined);
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
_.prototype.setHighlighted = function (surface) {
|
|
147
|
-
if (
|
|
148
|
-
this._highlightedSurface &&
|
|
149
|
-
!this._highlightedSurface.isDestroyed() &&
|
|
150
|
-
this._highlightedSurface != surface
|
|
151
|
-
) {
|
|
152
|
-
this._highlightedSurface.setHighlighted(false);
|
|
153
|
-
}
|
|
154
|
-
this._highlightedSurface = surface;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
_.prototype.disableAllEditMode = function () {
|
|
158
|
-
this.setEdited(undefined);
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
_.prototype.setEdited = function (surface) {
|
|
162
|
-
if (this._editedSurface && !this._editedSurface.isDestroyed()) {
|
|
163
|
-
this._editedSurface.setEditMode(false);
|
|
164
|
-
}
|
|
165
|
-
this._editedSurface = surface;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
var defaultShapeOptions = {
|
|
169
|
-
ellipsoid: Cesium.Ellipsoid.WGS84,
|
|
170
|
-
textureRotationAngle: 0.0,
|
|
171
|
-
height: 0.0,
|
|
172
|
-
asynchronous: true,
|
|
173
|
-
show: true,
|
|
174
|
-
debugShowBoundingVolume: false,
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
var defaultSurfaceOptions = copyOptions(defaultShapeOptions, {
|
|
178
|
-
appearance: new Cesium.EllipsoidSurfaceAppearance({
|
|
179
|
-
aboveGround: false,
|
|
180
|
-
}),
|
|
181
|
-
material: material,
|
|
182
|
-
granularity: Math.PI / 180.0,
|
|
183
|
-
});
|
|
184
|
-
|
|
185
|
-
var defaultPolygonOptions = copyOptions(defaultShapeOptions, {});
|
|
186
|
-
var defaultExtentOptions = copyOptions(defaultShapeOptions, {});
|
|
187
|
-
var defaultCircleOptions = copyOptions(defaultShapeOptions, {});
|
|
188
|
-
var defaultEllipseOptions = copyOptions(defaultSurfaceOptions, {
|
|
189
|
-
rotation: 0,
|
|
190
|
-
});
|
|
191
|
-
|
|
192
|
-
var defaultPolylineOptions = copyOptions(defaultShapeOptions, {
|
|
193
|
-
width: 5,
|
|
194
|
-
geodesic: true,
|
|
195
|
-
granularity: 10000,
|
|
196
|
-
appearance: new Cesium.PolylineMaterialAppearance({
|
|
197
|
-
aboveGround: false,
|
|
198
|
-
}),
|
|
199
|
-
material: material,
|
|
200
|
-
});
|
|
201
|
-
|
|
202
|
-
// Cesium.Polygon.prototype.setStrokeStyle = setStrokeStyle;
|
|
203
|
-
//
|
|
204
|
-
// Cesium.Polygon.prototype.drawOutline = drawOutline;
|
|
205
|
-
//
|
|
206
|
-
|
|
207
|
-
var ChangeablePrimitive = (function () {
|
|
208
|
-
function _() {}
|
|
209
|
-
|
|
210
|
-
_.prototype.initialiseOptions = function (options) {
|
|
211
|
-
fillOptions(this, options);
|
|
212
|
-
|
|
213
|
-
this._ellipsoid = undefined;
|
|
214
|
-
this._granularity = undefined;
|
|
215
|
-
this._height = undefined;
|
|
216
|
-
this._textureRotationAngle = undefined;
|
|
217
|
-
this._id = undefined;
|
|
218
|
-
|
|
219
|
-
// set the flags to initiate a first drawing
|
|
220
|
-
this._createPrimitive = true;
|
|
221
|
-
this._primitive = undefined;
|
|
222
|
-
this._outlinePolygon = undefined;
|
|
223
|
-
};
|
|
224
|
-
|
|
225
|
-
_.prototype.setAttribute = function (name, value) {
|
|
226
|
-
this[name] = value;
|
|
227
|
-
this._createPrimitive = true;
|
|
228
|
-
};
|
|
229
|
-
|
|
230
|
-
_.prototype.getAttribute = function (name) {
|
|
231
|
-
return this[name];
|
|
232
|
-
};
|
|
233
|
-
|
|
234
|
-
/**
|
|
235
|
-
* @private
|
|
236
|
-
*/
|
|
237
|
-
_.prototype.update = function (context, frameState, commandList) {
|
|
238
|
-
if (!Cesium.defined(this.ellipsoid)) {
|
|
239
|
-
throw new Cesium.DeveloperError('this.ellipsoid must be defined.');
|
|
240
|
-
}
|
|
241
|
-
|
|
242
|
-
if (!Cesium.defined(this.appearance)) {
|
|
243
|
-
throw new Cesium.DeveloperError('this.material must be defined.');
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
if (this.granularity < 0.0) {
|
|
247
|
-
throw new Cesium.DeveloperError(
|
|
248
|
-
'this.granularity and scene2D/scene3D overrides must be greater than zero.'
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
|
|
252
|
-
if (!this.show) {
|
|
253
|
-
return;
|
|
254
|
-
}
|
|
255
|
-
|
|
256
|
-
if (!this._createPrimitive && !Cesium.defined(this._primitive)) {
|
|
257
|
-
// No positions/hierarchy to draw
|
|
258
|
-
return;
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
if (
|
|
262
|
-
this._createPrimitive ||
|
|
263
|
-
this._ellipsoid !== this.ellipsoid ||
|
|
264
|
-
this._granularity !== this.granularity ||
|
|
265
|
-
this._height !== this.height ||
|
|
266
|
-
this._textureRotationAngle !== this.textureRotationAngle ||
|
|
267
|
-
this._id !== this.id
|
|
268
|
-
) {
|
|
269
|
-
var geometry = this.getGeometry();
|
|
270
|
-
if (!geometry) {
|
|
271
|
-
return;
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
this._createPrimitive = false;
|
|
275
|
-
this._ellipsoid = this.ellipsoid;
|
|
276
|
-
this._granularity = this.granularity;
|
|
277
|
-
this._height = this.height;
|
|
278
|
-
this._textureRotationAngle = this.textureRotationAngle;
|
|
279
|
-
this._id = this.id;
|
|
280
|
-
|
|
281
|
-
this._primitive = this._primitive && this._primitive.destroy();
|
|
282
|
-
|
|
283
|
-
this._primitive = new Cesium.Primitive({
|
|
284
|
-
geometryInstances: new Cesium.GeometryInstance({
|
|
285
|
-
geometry: geometry,
|
|
286
|
-
id: this.id,
|
|
287
|
-
pickPrimitive: this,
|
|
288
|
-
}),
|
|
289
|
-
appearance: this.appearance,
|
|
290
|
-
asynchronous: this.asynchronous,
|
|
291
|
-
});
|
|
292
|
-
|
|
293
|
-
this._outlinePolygon =
|
|
294
|
-
this._outlinePolygon && this._outlinePolygon.destroy();
|
|
295
|
-
if (this.strokeColor && this.getOutlineGeometry) {
|
|
296
|
-
// create the highlighting frame
|
|
297
|
-
this._outlinePolygon = new Cesium.Primitive({
|
|
298
|
-
geometryInstances: new Cesium.GeometryInstance({
|
|
299
|
-
geometry: this.getOutlineGeometry(),
|
|
300
|
-
attributes: {
|
|
301
|
-
color: Cesium.ColorGeometryInstanceAttribute.fromColor(
|
|
302
|
-
this.strokeColor
|
|
303
|
-
),
|
|
304
|
-
},
|
|
305
|
-
}),
|
|
306
|
-
appearance: new Cesium.PerInstanceColorAppearance({
|
|
307
|
-
flat: true,
|
|
308
|
-
renderState: {
|
|
309
|
-
depthTest: {
|
|
310
|
-
enabled: true,
|
|
311
|
-
},
|
|
312
|
-
//MC_CHANGE
|
|
313
|
-
lineWidth: this.strokeWidth || 4.0,
|
|
314
|
-
// lineWidth : Math.min(this.strokeWidth || 4.0, context._aliasedLineWidthRange[1])
|
|
315
|
-
},
|
|
316
|
-
}),
|
|
317
|
-
});
|
|
318
|
-
}
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
var primitive = this._primitive;
|
|
322
|
-
primitive.appearance.material = this.material;
|
|
323
|
-
primitive.debugShowBoundingVolume = this.debugShowBoundingVolume;
|
|
324
|
-
|
|
325
|
-
primitive.update(context, frameState, commandList);
|
|
326
|
-
|
|
327
|
-
this._outlinePolygon &&
|
|
328
|
-
this._outlinePolygon.update(context, frameState, commandList);
|
|
329
|
-
};
|
|
330
|
-
|
|
331
|
-
_.prototype.isDestroyed = function () {
|
|
332
|
-
return false;
|
|
333
|
-
};
|
|
334
|
-
|
|
335
|
-
_.prototype.destroy = function () {
|
|
336
|
-
this._primitive = this._primitive && this._primitive.destroy();
|
|
337
|
-
return Cesium.destroyObject(this);
|
|
338
|
-
};
|
|
339
|
-
|
|
340
|
-
_.prototype.setStrokeStyle = function (strokeColor, strokeWidth) {
|
|
341
|
-
if (
|
|
342
|
-
!this.strokeColor ||
|
|
343
|
-
!this.strokeColor.equals(strokeColor) ||
|
|
344
|
-
this.strokeWidth != strokeWidth
|
|
345
|
-
) {
|
|
346
|
-
this._createPrimitive = true;
|
|
347
|
-
this.strokeColor = strokeColor;
|
|
348
|
-
this.strokeWidth = strokeWidth;
|
|
349
|
-
}
|
|
350
|
-
};
|
|
351
|
-
|
|
352
|
-
return _;
|
|
353
|
-
})();
|
|
354
|
-
|
|
355
|
-
_.ExtentPrimitive = (function () {
|
|
356
|
-
function _(options) {
|
|
357
|
-
if (!Cesium.defined(options.extent)) {
|
|
358
|
-
throw new Cesium.DeveloperError('Extent is required');
|
|
359
|
-
}
|
|
360
|
-
|
|
361
|
-
options = copyOptions(options, defaultSurfaceOptions);
|
|
362
|
-
|
|
363
|
-
this.initialiseOptions(options);
|
|
364
|
-
|
|
365
|
-
this.setExtent(options.extent);
|
|
366
|
-
}
|
|
367
|
-
|
|
368
|
-
_.prototype = new ChangeablePrimitive();
|
|
369
|
-
|
|
370
|
-
_.prototype.setExtent = function (extent) {
|
|
371
|
-
this.setAttribute('extent', extent);
|
|
372
|
-
};
|
|
373
|
-
|
|
374
|
-
_.prototype.getExtent = function () {
|
|
375
|
-
return this.getAttribute('extent');
|
|
376
|
-
};
|
|
377
|
-
|
|
378
|
-
_.prototype.getGeometry = function () {
|
|
379
|
-
if (!Cesium.defined(this.extent)) {
|
|
380
|
-
return;
|
|
381
|
-
}
|
|
382
|
-
|
|
383
|
-
return new Cesium.RectangleGeometry({
|
|
384
|
-
rectangle: this.extent,
|
|
385
|
-
height: this.height,
|
|
386
|
-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
387
|
-
stRotation: this.textureRotationAngle,
|
|
388
|
-
ellipsoid: this.ellipsoid,
|
|
389
|
-
granularity: this.granularity,
|
|
390
|
-
});
|
|
391
|
-
};
|
|
392
|
-
|
|
393
|
-
_.prototype.getOutlineGeometry = function () {
|
|
394
|
-
return new Cesium.RectangleOutlineGeometry({
|
|
395
|
-
rectangle: this.extent,
|
|
396
|
-
});
|
|
397
|
-
};
|
|
398
|
-
|
|
399
|
-
return _;
|
|
400
|
-
})();
|
|
401
|
-
|
|
402
|
-
_.PolygonPrimitive = (function () {
|
|
403
|
-
function _(options) {
|
|
404
|
-
options = copyOptions(options, defaultSurfaceOptions);
|
|
405
|
-
|
|
406
|
-
this.initialiseOptions(options);
|
|
407
|
-
|
|
408
|
-
this.isPolygon = true;
|
|
409
|
-
}
|
|
410
|
-
|
|
411
|
-
_.prototype = new ChangeablePrimitive();
|
|
412
|
-
|
|
413
|
-
_.prototype.setPositions = function (positions) {
|
|
414
|
-
this.setAttribute('positions', positions);
|
|
415
|
-
};
|
|
416
|
-
|
|
417
|
-
_.prototype.getPositions = function () {
|
|
418
|
-
return this.getAttribute('positions');
|
|
419
|
-
};
|
|
420
|
-
|
|
421
|
-
_.prototype.getGeometry = function () {
|
|
422
|
-
if (!Cesium.defined(this.positions) || this.positions.length < 3) {
|
|
423
|
-
return;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
return Cesium.PolygonGeometry.fromPositions({
|
|
427
|
-
positions: this.positions,
|
|
428
|
-
height: this.height,
|
|
429
|
-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
430
|
-
stRotation: this.textureRotationAngle,
|
|
431
|
-
ellipsoid: this.ellipsoid,
|
|
432
|
-
granularity: this.granularity,
|
|
433
|
-
});
|
|
434
|
-
};
|
|
435
|
-
|
|
436
|
-
_.prototype.getOutlineGeometry = function () {
|
|
437
|
-
return Cesium.PolygonOutlineGeometry.fromPositions({
|
|
438
|
-
positions: this.getPositions(),
|
|
439
|
-
});
|
|
440
|
-
};
|
|
441
|
-
|
|
442
|
-
return _;
|
|
443
|
-
})();
|
|
444
|
-
|
|
445
|
-
_.CirclePrimitive = (function () {
|
|
446
|
-
function _(options) {
|
|
447
|
-
if (!(Cesium.defined(options.center) && Cesium.defined(options.radius))) {
|
|
448
|
-
throw new Cesium.DeveloperError('Center and radius are required');
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
options = copyOptions(options, defaultSurfaceOptions);
|
|
452
|
-
|
|
453
|
-
this.initialiseOptions(options);
|
|
454
|
-
|
|
455
|
-
this.setRadius(options.radius);
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
_.prototype = new ChangeablePrimitive();
|
|
459
|
-
|
|
460
|
-
_.prototype.setCenter = function (center) {
|
|
461
|
-
this.setAttribute('center', center);
|
|
462
|
-
};
|
|
463
|
-
|
|
464
|
-
_.prototype.setRadius = function (radius) {
|
|
465
|
-
this.setAttribute('radius', Math.max(0.1, radius));
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
_.prototype.getCenter = function () {
|
|
469
|
-
return this.getAttribute('center');
|
|
470
|
-
};
|
|
471
|
-
|
|
472
|
-
_.prototype.getRadius = function () {
|
|
473
|
-
return this.getAttribute('radius');
|
|
474
|
-
};
|
|
475
|
-
|
|
476
|
-
_.prototype.getGeometry = function () {
|
|
477
|
-
if (!(Cesium.defined(this.center) && Cesium.defined(this.radius))) {
|
|
478
|
-
return;
|
|
479
|
-
}
|
|
480
|
-
|
|
481
|
-
return new Cesium.CircleGeometry({
|
|
482
|
-
center: this.center,
|
|
483
|
-
radius: this.radius,
|
|
484
|
-
height: this.height,
|
|
485
|
-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
486
|
-
stRotation: this.textureRotationAngle,
|
|
487
|
-
ellipsoid: this.ellipsoid,
|
|
488
|
-
granularity: this.granularity,
|
|
489
|
-
});
|
|
490
|
-
};
|
|
491
|
-
|
|
492
|
-
_.prototype.getOutlineGeometry = function () {
|
|
493
|
-
return new Cesium.CircleOutlineGeometry({
|
|
494
|
-
center: this.getCenter(),
|
|
495
|
-
radius: this.getRadius(),
|
|
496
|
-
});
|
|
497
|
-
};
|
|
498
|
-
|
|
499
|
-
return _;
|
|
500
|
-
})();
|
|
501
|
-
|
|
502
|
-
_.EllipsePrimitive = (function () {
|
|
503
|
-
function _(options) {
|
|
504
|
-
if (
|
|
505
|
-
!(
|
|
506
|
-
Cesium.defined(options.center) &&
|
|
507
|
-
Cesium.defined(options.semiMajorAxis) &&
|
|
508
|
-
Cesium.defined(options.semiMinorAxis)
|
|
509
|
-
)
|
|
510
|
-
) {
|
|
511
|
-
throw new Cesium.DeveloperError(
|
|
512
|
-
'Center and semi major and semi minor axis are required'
|
|
513
|
-
);
|
|
514
|
-
}
|
|
515
|
-
|
|
516
|
-
options = copyOptions(options, defaultEllipseOptions);
|
|
517
|
-
|
|
518
|
-
this.initialiseOptions(options);
|
|
519
|
-
}
|
|
520
|
-
|
|
521
|
-
_.prototype = new ChangeablePrimitive();
|
|
522
|
-
|
|
523
|
-
_.prototype.setCenter = function (center) {
|
|
524
|
-
this.setAttribute('center', center);
|
|
525
|
-
};
|
|
526
|
-
|
|
527
|
-
_.prototype.setSemiMajorAxis = function (semiMajorAxis) {
|
|
528
|
-
if (semiMajorAxis < this.getSemiMinorAxis()) return;
|
|
529
|
-
this.setAttribute('semiMajorAxis', semiMajorAxis);
|
|
530
|
-
};
|
|
531
|
-
|
|
532
|
-
_.prototype.setSemiMinorAxis = function (semiMinorAxis) {
|
|
533
|
-
if (semiMinorAxis > this.getSemiMajorAxis()) return;
|
|
534
|
-
this.setAttribute('semiMinorAxis', semiMinorAxis);
|
|
535
|
-
};
|
|
536
|
-
|
|
537
|
-
_.prototype.setRotation = function (rotation) {
|
|
538
|
-
return this.setAttribute('rotation', rotation);
|
|
539
|
-
};
|
|
540
|
-
|
|
541
|
-
_.prototype.getCenter = function () {
|
|
542
|
-
return this.getAttribute('center');
|
|
543
|
-
};
|
|
544
|
-
|
|
545
|
-
_.prototype.getSemiMajorAxis = function () {
|
|
546
|
-
return this.getAttribute('semiMajorAxis');
|
|
547
|
-
};
|
|
548
|
-
|
|
549
|
-
_.prototype.getSemiMinorAxis = function () {
|
|
550
|
-
return this.getAttribute('semiMinorAxis');
|
|
551
|
-
};
|
|
552
|
-
|
|
553
|
-
_.prototype.getRotation = function () {
|
|
554
|
-
return this.getAttribute('rotation');
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
_.prototype.getGeometry = function () {
|
|
558
|
-
if (
|
|
559
|
-
!(
|
|
560
|
-
Cesium.defined(this.center) &&
|
|
561
|
-
Cesium.defined(this.semiMajorAxis) &&
|
|
562
|
-
Cesium.defined(this.semiMinorAxis)
|
|
563
|
-
)
|
|
564
|
-
) {
|
|
565
|
-
return;
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
return new Cesium.EllipseGeometry({
|
|
569
|
-
ellipsoid: this.ellipsoid,
|
|
570
|
-
center: this.center,
|
|
571
|
-
semiMajorAxis: this.semiMajorAxis,
|
|
572
|
-
semiMinorAxis: this.semiMinorAxis,
|
|
573
|
-
rotation: this.rotation,
|
|
574
|
-
height: this.height,
|
|
575
|
-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
576
|
-
stRotation: this.textureRotationAngle,
|
|
577
|
-
ellipsoid: this.ellipsoid,
|
|
578
|
-
granularity: this.granularity,
|
|
579
|
-
});
|
|
580
|
-
};
|
|
581
|
-
|
|
582
|
-
_.prototype.getOutlineGeometry = function () {
|
|
583
|
-
return new Cesium.EllipseOutlineGeometry({
|
|
584
|
-
center: this.getCenter(),
|
|
585
|
-
semiMajorAxis: this.getSemiMajorAxis(),
|
|
586
|
-
semiMinorAxis: this.getSemiMinorAxis(),
|
|
587
|
-
rotation: this.getRotation(),
|
|
588
|
-
});
|
|
589
|
-
};
|
|
590
|
-
|
|
591
|
-
return _;
|
|
592
|
-
})();
|
|
593
|
-
|
|
594
|
-
_.PolylinePrimitive = (function () {
|
|
595
|
-
function _(options) {
|
|
596
|
-
options = copyOptions(options, defaultPolylineOptions);
|
|
597
|
-
|
|
598
|
-
this.initialiseOptions(options);
|
|
599
|
-
}
|
|
600
|
-
|
|
601
|
-
_.prototype = new ChangeablePrimitive();
|
|
602
|
-
|
|
603
|
-
_.prototype.setPositions = function (positions) {
|
|
604
|
-
this.setAttribute('positions', positions);
|
|
605
|
-
};
|
|
606
|
-
|
|
607
|
-
_.prototype.setWidth = function (width) {
|
|
608
|
-
this.setAttribute('width', width);
|
|
609
|
-
};
|
|
610
|
-
|
|
611
|
-
_.prototype.setGeodesic = function (geodesic) {
|
|
612
|
-
this.setAttribute('geodesic', geodesic);
|
|
613
|
-
};
|
|
614
|
-
|
|
615
|
-
_.prototype.getPositions = function () {
|
|
616
|
-
return this.getAttribute('positions');
|
|
617
|
-
};
|
|
618
|
-
|
|
619
|
-
_.prototype.getWidth = function () {
|
|
620
|
-
return this.getAttribute('width');
|
|
621
|
-
};
|
|
622
|
-
|
|
623
|
-
_.prototype.getGeodesic = function (geodesic) {
|
|
624
|
-
return this.getAttribute('geodesic');
|
|
625
|
-
};
|
|
626
|
-
|
|
627
|
-
_.prototype.getGeometry = function () {
|
|
628
|
-
if (!Cesium.defined(this.positions) || this.positions.length < 2) {
|
|
629
|
-
return;
|
|
630
|
-
}
|
|
631
|
-
|
|
632
|
-
return new Cesium.PolylineGeometry({
|
|
633
|
-
positions: this.positions,
|
|
634
|
-
height: this.height,
|
|
635
|
-
width: this.width < 1 ? 1 : this.width,
|
|
636
|
-
vertexFormat: Cesium.EllipsoidSurfaceAppearance.VERTEX_FORMAT,
|
|
637
|
-
ellipsoid: this.ellipsoid,
|
|
638
|
-
});
|
|
639
|
-
};
|
|
640
|
-
|
|
641
|
-
return _;
|
|
642
|
-
})();
|
|
643
|
-
|
|
644
|
-
var defaultBillboard = {
|
|
645
|
-
iconUrl: './assets/img/dragIcon.png',
|
|
646
|
-
shiftX: 0,
|
|
647
|
-
shiftY: 0,
|
|
648
|
-
};
|
|
649
|
-
|
|
650
|
-
var dragBillboard = {
|
|
651
|
-
iconUrl: './assets/img/dragIcon.png',
|
|
652
|
-
shiftX: 0,
|
|
653
|
-
shiftY: 0,
|
|
654
|
-
};
|
|
655
|
-
|
|
656
|
-
var dragHalfBillboard = {
|
|
657
|
-
iconUrl: './assets/img/dragIconLight.png',
|
|
658
|
-
shiftX: 0,
|
|
659
|
-
shiftY: 0,
|
|
660
|
-
};
|
|
661
|
-
|
|
662
|
-
_.prototype.createBillboardGroup = function (points, options, callbacks) {
|
|
663
|
-
var markers = new _.BillboardGroup(this, options);
|
|
664
|
-
markers.addBillboards(points, callbacks);
|
|
665
|
-
return markers;
|
|
666
|
-
};
|
|
667
|
-
|
|
668
|
-
_.BillboardGroup = function (drawHelper, options) {
|
|
669
|
-
this._drawHelper = drawHelper;
|
|
670
|
-
this._scene = drawHelper._scene;
|
|
671
|
-
|
|
672
|
-
this._options = copyOptions(options, defaultBillboard);
|
|
673
|
-
|
|
674
|
-
// create one common billboard collection for all billboards
|
|
675
|
-
var b = new Cesium.BillboardCollection();
|
|
676
|
-
this._scene.primitives.add(b);
|
|
677
|
-
this._billboards = b;
|
|
678
|
-
// keep an ordered list of billboards
|
|
679
|
-
this._orderedBillboards = [];
|
|
680
|
-
};
|
|
681
|
-
|
|
682
|
-
_.BillboardGroup.prototype.createBillboard = function (position, callbacks) {
|
|
683
|
-
var billboard = this._billboards.add({
|
|
684
|
-
show: true,
|
|
685
|
-
position: position,
|
|
686
|
-
pixelOffset: new Cesium.Cartesian2(
|
|
687
|
-
this._options.shiftX,
|
|
688
|
-
this._options.shiftY
|
|
689
|
-
),
|
|
690
|
-
eyeOffset: new Cesium.Cartesian3(0.0, 0.0, 0.0),
|
|
691
|
-
horizontalOrigin: Cesium.HorizontalOrigin.CENTER,
|
|
692
|
-
verticalOrigin: Cesium.VerticalOrigin.CENTER,
|
|
693
|
-
scale: 1.0,
|
|
694
|
-
image: this._options.iconUrl,
|
|
695
|
-
color: drawingVertexColor,
|
|
696
|
-
});
|
|
697
|
-
|
|
698
|
-
// if editable
|
|
699
|
-
if (callbacks) {
|
|
700
|
-
var _self = this;
|
|
701
|
-
var screenSpaceCameraController = this._scene.screenSpaceCameraController;
|
|
702
|
-
function enableRotation(enable) {
|
|
703
|
-
screenSpaceCameraController.enableRotate = enable;
|
|
704
|
-
}
|
|
705
|
-
function getIndex() {
|
|
706
|
-
// find index
|
|
707
|
-
for (
|
|
708
|
-
var i = 0, I = _self._orderedBillboards.length;
|
|
709
|
-
i < I && _self._orderedBillboards[i] != billboard;
|
|
710
|
-
++i
|
|
711
|
-
);
|
|
712
|
-
return i;
|
|
713
|
-
}
|
|
714
|
-
if (callbacks.dragHandlers) {
|
|
715
|
-
var _self = this;
|
|
716
|
-
setListener(billboard, 'leftDown', function (position) {
|
|
717
|
-
// TODO - start the drag handlers here
|
|
718
|
-
// create handlers for mouseOut and leftUp for the billboard and a mouseMove
|
|
719
|
-
function onDrag(position) {
|
|
720
|
-
billboard.position = position;
|
|
721
|
-
// find index
|
|
722
|
-
for (
|
|
723
|
-
var i = 0, I = _self._orderedBillboards.length;
|
|
724
|
-
i < I && _self._orderedBillboards[i] != billboard;
|
|
725
|
-
++i
|
|
726
|
-
);
|
|
727
|
-
callbacks.dragHandlers.onDrag &&
|
|
728
|
-
callbacks.dragHandlers.onDrag(getIndex(), position);
|
|
729
|
-
}
|
|
730
|
-
function onDragEnd(position) {
|
|
731
|
-
handler.destroy();
|
|
732
|
-
enableRotation(true);
|
|
733
|
-
callbacks.dragHandlers.onDragEnd &&
|
|
734
|
-
callbacks.dragHandlers.onDragEnd(getIndex(), position);
|
|
735
|
-
}
|
|
736
|
-
|
|
737
|
-
var handler = new Cesium.ScreenSpaceEventHandler(_self._scene.canvas);
|
|
738
|
-
|
|
739
|
-
handler.setInputAction(function (movement) {
|
|
740
|
-
var cartesian = _self._scene.camera.pickEllipsoid(
|
|
741
|
-
movement.endPosition,
|
|
742
|
-
ellipsoid
|
|
743
|
-
);
|
|
744
|
-
if (cartesian) {
|
|
745
|
-
onDrag(cartesian);
|
|
746
|
-
} else {
|
|
747
|
-
onDragEnd(cartesian);
|
|
748
|
-
}
|
|
749
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
750
|
-
|
|
751
|
-
handler.setInputAction(function (movement) {
|
|
752
|
-
onDragEnd(
|
|
753
|
-
_self._scene.camera.pickEllipsoid(movement.position, ellipsoid)
|
|
754
|
-
);
|
|
755
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
756
|
-
|
|
757
|
-
enableRotation(false);
|
|
758
|
-
|
|
759
|
-
callbacks.dragHandlers.onDragStart &&
|
|
760
|
-
callbacks.dragHandlers.onDragStart(
|
|
761
|
-
getIndex(),
|
|
762
|
-
_self._scene.camera.pickEllipsoid(position, ellipsoid)
|
|
763
|
-
);
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
if (callbacks.onDoubleClick) {
|
|
767
|
-
setListener(billboard, 'leftDoubleClick', function (position) {
|
|
768
|
-
callbacks.onDoubleClick(getIndex());
|
|
769
|
-
});
|
|
770
|
-
}
|
|
771
|
-
if (callbacks.onClick) {
|
|
772
|
-
setListener(billboard, 'leftClick', function (position) {
|
|
773
|
-
callbacks.onClick(getIndex());
|
|
774
|
-
});
|
|
775
|
-
}
|
|
776
|
-
if (callbacks.tooltip) {
|
|
777
|
-
setListener(billboard, 'mouseMove', function (position) {
|
|
778
|
-
_self._drawHelper._tooltip.showAt(position, callbacks.tooltip());
|
|
779
|
-
});
|
|
780
|
-
setListener(billboard, 'mouseOut', function (position) {
|
|
781
|
-
_self._drawHelper._tooltip.setVisible(false);
|
|
782
|
-
});
|
|
783
|
-
}
|
|
784
|
-
}
|
|
785
|
-
|
|
786
|
-
return billboard;
|
|
787
|
-
};
|
|
788
|
-
|
|
789
|
-
_.BillboardGroup.prototype.insertBillboard = function (
|
|
790
|
-
index,
|
|
791
|
-
position,
|
|
792
|
-
callbacks
|
|
793
|
-
) {
|
|
794
|
-
this._orderedBillboards.splice(
|
|
795
|
-
index,
|
|
796
|
-
0,
|
|
797
|
-
this.createBillboard(position, callbacks)
|
|
798
|
-
);
|
|
799
|
-
};
|
|
800
|
-
|
|
801
|
-
_.BillboardGroup.prototype.addBillboard = function (position, callbacks) {
|
|
802
|
-
this._orderedBillboards.push(this.createBillboard(position, callbacks));
|
|
803
|
-
};
|
|
804
|
-
|
|
805
|
-
_.BillboardGroup.prototype.addBillboards = function (positions, callbacks) {
|
|
806
|
-
var index = 0;
|
|
807
|
-
for (; index < positions.length; index++) {
|
|
808
|
-
this.addBillboard(positions[index], callbacks);
|
|
809
|
-
}
|
|
810
|
-
};
|
|
811
|
-
|
|
812
|
-
_.BillboardGroup.prototype.updateBillboardsPositions = function (positions) {
|
|
813
|
-
var index = 0;
|
|
814
|
-
for (; index < positions.length; index++) {
|
|
815
|
-
this.getBillboard(index).position = positions[index];
|
|
816
|
-
}
|
|
817
|
-
};
|
|
818
|
-
|
|
819
|
-
_.BillboardGroup.prototype.countBillboards = function () {
|
|
820
|
-
return this._orderedBillboards.length;
|
|
821
|
-
};
|
|
822
|
-
|
|
823
|
-
_.BillboardGroup.prototype.getBillboard = function (index) {
|
|
824
|
-
return this._orderedBillboards[index];
|
|
825
|
-
};
|
|
826
|
-
|
|
827
|
-
_.BillboardGroup.prototype.removeBillboard = function (index) {
|
|
828
|
-
this._billboards.remove(this.getBillboard(index));
|
|
829
|
-
this._orderedBillboards.splice(index, 1);
|
|
830
|
-
};
|
|
831
|
-
|
|
832
|
-
_.BillboardGroup.prototype.remove = function () {
|
|
833
|
-
this._billboards =
|
|
834
|
-
this._billboards &&
|
|
835
|
-
this._billboards.removeAll() &&
|
|
836
|
-
this._billboards.destroy();
|
|
837
|
-
};
|
|
838
|
-
|
|
839
|
-
_.BillboardGroup.prototype.setOnTop = function () {
|
|
840
|
-
this._scene.primitives.raiseToTop(this._billboards);
|
|
841
|
-
};
|
|
842
|
-
|
|
843
|
-
_.prototype.startDrawingMarker = function (options) {
|
|
844
|
-
var options = copyOptions(options, defaultBillboard);
|
|
845
|
-
|
|
846
|
-
this.startDrawing(function () {
|
|
847
|
-
markers.remove();
|
|
848
|
-
mouseHandler.destroy();
|
|
849
|
-
tooltip.setVisible(false);
|
|
850
|
-
});
|
|
851
|
-
|
|
852
|
-
var _self = this;
|
|
853
|
-
var scene = this._scene;
|
|
854
|
-
var primitives = scene.primitives;
|
|
855
|
-
var tooltip = this._tooltip;
|
|
856
|
-
|
|
857
|
-
var markers = new _.BillboardGroup(this, options);
|
|
858
|
-
|
|
859
|
-
var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
860
|
-
|
|
861
|
-
// Now wait for start
|
|
862
|
-
mouseHandler.setInputAction(function (movement) {
|
|
863
|
-
if (movement.position != null) {
|
|
864
|
-
var cartesian = scene.camera.pickEllipsoid(
|
|
865
|
-
movement.position,
|
|
866
|
-
ellipsoid
|
|
867
|
-
);
|
|
868
|
-
if (cartesian) {
|
|
869
|
-
markers.addBillboard(cartesian);
|
|
870
|
-
_self.stopDrawing();
|
|
871
|
-
options.callback(cartesian);
|
|
872
|
-
}
|
|
873
|
-
}
|
|
874
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
875
|
-
|
|
876
|
-
mouseHandler.setInputAction(function (movement) {
|
|
877
|
-
var position = movement.endPosition;
|
|
878
|
-
if (position != null) {
|
|
879
|
-
var cartesian = scene.camera.pickEllipsoid(position, ellipsoid);
|
|
880
|
-
if (cartesian) {
|
|
881
|
-
tooltip.showAt(
|
|
882
|
-
position,
|
|
883
|
-
'<p>Click to add your marker. Position is: </p>' +
|
|
884
|
-
getDisplayLatLngString(
|
|
885
|
-
ellipsoid.cartesianToCartographic(cartesian)
|
|
886
|
-
)
|
|
887
|
-
);
|
|
888
|
-
} else {
|
|
889
|
-
tooltip.showAt(
|
|
890
|
-
position,
|
|
891
|
-
'<p>Click on the globe to add your marker.</p>'
|
|
892
|
-
);
|
|
893
|
-
}
|
|
894
|
-
}
|
|
895
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
896
|
-
};
|
|
897
|
-
|
|
898
|
-
_.prototype.startDrawingPolygon = function (options) {
|
|
899
|
-
var options = copyOptions(options, defaultSurfaceOptions);
|
|
900
|
-
this.startDrawingPolyshape(true, options);
|
|
901
|
-
};
|
|
902
|
-
|
|
903
|
-
_.prototype.startDrawingPolyline = function (options) {
|
|
904
|
-
var options = copyOptions(options, defaultPolylineOptions);
|
|
905
|
-
this.startDrawingPolyshape(false, options);
|
|
906
|
-
};
|
|
907
|
-
|
|
908
|
-
_.prototype.startDrawingPolyshape = function (isPolygon, options) {
|
|
909
|
-
this.startDrawing(function () {
|
|
910
|
-
primitives.remove(poly);
|
|
911
|
-
markers.remove();
|
|
912
|
-
mouseHandler.destroy();
|
|
913
|
-
tooltip.setVisible(false);
|
|
914
|
-
unsetDrawCursor(scene);
|
|
915
|
-
});
|
|
916
|
-
|
|
917
|
-
var _self = this;
|
|
918
|
-
var scene = this._scene;
|
|
919
|
-
var primitives = scene.primitives;
|
|
920
|
-
var tooltip = this._tooltip;
|
|
921
|
-
|
|
922
|
-
var minPoints = isPolygon ? 3 : 2;
|
|
923
|
-
var poly;
|
|
924
|
-
if (isPolygon) {
|
|
925
|
-
poly = new DrawHelper.PolygonPrimitive(options);
|
|
926
|
-
} else {
|
|
927
|
-
poly = new DrawHelper.PolylinePrimitive(options);
|
|
928
|
-
}
|
|
929
|
-
poly.asynchronous = false;
|
|
930
|
-
primitives.add(poly);
|
|
931
|
-
|
|
932
|
-
var positions = [];
|
|
933
|
-
var markers = new _.BillboardGroup(this, defaultBillboard);
|
|
934
|
-
|
|
935
|
-
var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
936
|
-
setDrawCursor(scene);
|
|
937
|
-
|
|
938
|
-
// Now wait for start
|
|
939
|
-
mouseHandler.setInputAction(function (movement) {
|
|
940
|
-
if (movement.position != null) {
|
|
941
|
-
var cartesian = scene.camera.pickEllipsoid(
|
|
942
|
-
movement.position,
|
|
943
|
-
ellipsoid
|
|
944
|
-
);
|
|
945
|
-
if (cartesian) {
|
|
946
|
-
// first click
|
|
947
|
-
if (positions.length == 0) {
|
|
948
|
-
positions.push(cartesian.clone());
|
|
949
|
-
markers.addBillboard(positions[0]);
|
|
950
|
-
}
|
|
951
|
-
if (positions.length >= minPoints) {
|
|
952
|
-
poly.positions = positions;
|
|
953
|
-
poly._createPrimitive = true;
|
|
954
|
-
}
|
|
955
|
-
// add new point to polygon
|
|
956
|
-
// this one will move with the mouse
|
|
957
|
-
positions.push(cartesian);
|
|
958
|
-
// add marker at the new position
|
|
959
|
-
markers.addBillboard(cartesian);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
963
|
-
|
|
964
|
-
mouseHandler.setInputAction(function (movement) {
|
|
965
|
-
var position = movement.endPosition;
|
|
966
|
-
if (position != null) {
|
|
967
|
-
if (positions.length == 0) {
|
|
968
|
-
tooltip.showAt(position, '<p>Click to add first point</p>');
|
|
969
|
-
} else {
|
|
970
|
-
var cartesian = scene.camera.pickEllipsoid(position, ellipsoid);
|
|
971
|
-
if (cartesian) {
|
|
972
|
-
positions.pop();
|
|
973
|
-
// make sure it is slightly different
|
|
974
|
-
cartesian.y += 1 + Math.random();
|
|
975
|
-
positions.push(cartesian);
|
|
976
|
-
if (positions.length >= minPoints) {
|
|
977
|
-
poly.positions = positions;
|
|
978
|
-
poly._createPrimitive = true;
|
|
979
|
-
}
|
|
980
|
-
// update marker
|
|
981
|
-
markers.getBillboard(positions.length - 1).position = cartesian;
|
|
982
|
-
// show tooltip
|
|
983
|
-
tooltip.showAt(
|
|
984
|
-
position,
|
|
985
|
-
'<p>Click to add new point (' +
|
|
986
|
-
positions.length +
|
|
987
|
-
')</p>' +
|
|
988
|
-
(positions.length > minPoints
|
|
989
|
-
? '<p>Double click to finish drawing</p>'
|
|
990
|
-
: '')
|
|
991
|
-
);
|
|
992
|
-
}
|
|
993
|
-
}
|
|
994
|
-
}
|
|
995
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
996
|
-
|
|
997
|
-
mouseHandler.setInputAction(function (movement) {
|
|
998
|
-
var position = movement.position;
|
|
999
|
-
if (position != null) {
|
|
1000
|
-
if (positions.length < minPoints + 2) {
|
|
1001
|
-
return;
|
|
1002
|
-
} else {
|
|
1003
|
-
var cartesian = scene.camera.pickEllipsoid(position, ellipsoid);
|
|
1004
|
-
if (cartesian) {
|
|
1005
|
-
unsetDrawCursor(scene);
|
|
1006
|
-
_self.stopDrawing();
|
|
1007
|
-
if (typeof options.callback == 'function') {
|
|
1008
|
-
// remove overlapping ones
|
|
1009
|
-
var index = positions.length - 1;
|
|
1010
|
-
options.callback(positions);
|
|
1011
|
-
}
|
|
1012
|
-
}
|
|
1013
|
-
}
|
|
1014
|
-
}
|
|
1015
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOUBLE_CLICK);
|
|
1016
|
-
};
|
|
1017
|
-
|
|
1018
|
-
function getExtentCorners(value) {
|
|
1019
|
-
return ellipsoid.cartographicArrayToCartesianArray([
|
|
1020
|
-
Cesium.Rectangle.northwest(value),
|
|
1021
|
-
Cesium.Rectangle.northeast(value),
|
|
1022
|
-
Cesium.Rectangle.southeast(value),
|
|
1023
|
-
Cesium.Rectangle.southwest(value),
|
|
1024
|
-
]);
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1027
|
-
// MC_CHANGE add to change draw mode cursor
|
|
1028
|
-
function setDrawCursor(scene) {
|
|
1029
|
-
if (scene) {
|
|
1030
|
-
scene.canvas.style.cursor = 'crosshair';
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
|
|
1034
|
-
// MC_CHANGE add to restore regular mode
|
|
1035
|
-
function unsetDrawCursor(scene) {
|
|
1036
|
-
if (scene) {
|
|
1037
|
-
scene.canvas.style.cursor = '';
|
|
1038
|
-
}
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
_.prototype.startDrawingExtent = function (options) {
|
|
1042
|
-
var options = copyOptions(options, defaultSurfaceOptions);
|
|
1043
|
-
|
|
1044
|
-
this.startDrawing(function () {
|
|
1045
|
-
if (extent != null) {
|
|
1046
|
-
primitives.remove(extent);
|
|
1047
|
-
}
|
|
1048
|
-
//MC_CHANGE if added
|
|
1049
|
-
if (markers != null) {
|
|
1050
|
-
markers.remove();
|
|
1051
|
-
}
|
|
1052
|
-
mouseHandler.destroy();
|
|
1053
|
-
tooltip.setVisible(false);
|
|
1054
|
-
unsetDrawCursor(scene);
|
|
1055
|
-
});
|
|
1056
|
-
|
|
1057
|
-
var _self = this;
|
|
1058
|
-
var scene = this._scene;
|
|
1059
|
-
var primitives = this._scene.primitives;
|
|
1060
|
-
var tooltip = this._tooltip;
|
|
1061
|
-
|
|
1062
|
-
var firstPoint = null;
|
|
1063
|
-
var extent = null;
|
|
1064
|
-
var markers = null;
|
|
1065
|
-
|
|
1066
|
-
var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
1067
|
-
setDrawCursor(scene);
|
|
1068
|
-
|
|
1069
|
-
function updateExtent(value) {
|
|
1070
|
-
if (extent == null) {
|
|
1071
|
-
//MC_CHANGE
|
|
1072
|
-
extent = new DrawHelper.ExtentPrimitive({
|
|
1073
|
-
extent: value,
|
|
1074
|
-
material: options.material,
|
|
1075
|
-
});
|
|
1076
|
-
//extent = new Cesium.RectanglePrimitive();
|
|
1077
|
-
extent.asynchronous = false;
|
|
1078
|
-
primitives.add(extent);
|
|
1079
|
-
}
|
|
1080
|
-
extent.setExtent(value);
|
|
1081
|
-
// update the markers
|
|
1082
|
-
var corners = getExtentCorners(value);
|
|
1083
|
-
// create if they do not yet exist
|
|
1084
|
-
if (markers == null) {
|
|
1085
|
-
markers = new _.BillboardGroup(_self, defaultBillboard);
|
|
1086
|
-
markers.addBillboards(corners);
|
|
1087
|
-
} else {
|
|
1088
|
-
markers.updateBillboardsPositions(corners);
|
|
1089
|
-
}
|
|
1090
|
-
}
|
|
1091
|
-
|
|
1092
|
-
// Now wait for start
|
|
1093
|
-
mouseHandler.setInputAction(function (movement) {
|
|
1094
|
-
if (movement.position != null) {
|
|
1095
|
-
var cartesian = scene.camera.pickEllipsoid(
|
|
1096
|
-
movement.position,
|
|
1097
|
-
ellipsoid
|
|
1098
|
-
);
|
|
1099
|
-
if (cartesian) {
|
|
1100
|
-
if (extent == null) {
|
|
1101
|
-
// create the rectangle
|
|
1102
|
-
firstPoint = ellipsoid.cartesianToCartographic(cartesian);
|
|
1103
|
-
var value = getExtent(firstPoint, firstPoint);
|
|
1104
|
-
updateExtent(value);
|
|
1105
|
-
} else {
|
|
1106
|
-
_self.stopDrawing();
|
|
1107
|
-
if (typeof options.callback == 'function') {
|
|
1108
|
-
options.callback(
|
|
1109
|
-
getExtent(
|
|
1110
|
-
firstPoint,
|
|
1111
|
-
ellipsoid.cartesianToCartographic(cartesian)
|
|
1112
|
-
)
|
|
1113
|
-
);
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
}
|
|
1117
|
-
}
|
|
1118
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
1119
|
-
|
|
1120
|
-
mouseHandler.setInputAction(function (movement) {
|
|
1121
|
-
var position = movement.endPosition;
|
|
1122
|
-
if (position != null) {
|
|
1123
|
-
if (extent == null) {
|
|
1124
|
-
tooltip.showAt(position, '<p>Click to start drawing rectangle</p>');
|
|
1125
|
-
} else {
|
|
1126
|
-
var cartesian = scene.camera.pickEllipsoid(position, ellipsoid);
|
|
1127
|
-
if (cartesian) {
|
|
1128
|
-
var value = getExtent(
|
|
1129
|
-
firstPoint,
|
|
1130
|
-
ellipsoid.cartesianToCartographic(cartesian)
|
|
1131
|
-
);
|
|
1132
|
-
updateExtent(value);
|
|
1133
|
-
tooltip.showAt(
|
|
1134
|
-
position,
|
|
1135
|
-
'<p>Drag to change rectangle extent</p><p>Click again to finish drawing</p>'
|
|
1136
|
-
);
|
|
1137
|
-
}
|
|
1138
|
-
}
|
|
1139
|
-
}
|
|
1140
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
1141
|
-
};
|
|
1142
|
-
|
|
1143
|
-
_.prototype.startDrawingCircle = function (options) {
|
|
1144
|
-
var options = copyOptions(options, defaultSurfaceOptions);
|
|
1145
|
-
|
|
1146
|
-
this.startDrawing(function cleanUp() {
|
|
1147
|
-
if (circle != null) {
|
|
1148
|
-
primitives.remove(circle);
|
|
1149
|
-
}
|
|
1150
|
-
markers.remove();
|
|
1151
|
-
mouseHandler.destroy();
|
|
1152
|
-
tooltip.setVisible(false);
|
|
1153
|
-
});
|
|
1154
|
-
|
|
1155
|
-
var _self = this;
|
|
1156
|
-
var scene = this._scene;
|
|
1157
|
-
var primitives = this._scene.primitives;
|
|
1158
|
-
var tooltip = this._tooltip;
|
|
1159
|
-
|
|
1160
|
-
var circle = null;
|
|
1161
|
-
var markers = null;
|
|
1162
|
-
|
|
1163
|
-
var mouseHandler = new Cesium.ScreenSpaceEventHandler(scene.canvas);
|
|
1164
|
-
|
|
1165
|
-
// Now wait for start
|
|
1166
|
-
mouseHandler.setInputAction(function (movement) {
|
|
1167
|
-
if (movement.position != null) {
|
|
1168
|
-
var cartesian = scene.camera.pickEllipsoid(
|
|
1169
|
-
movement.position,
|
|
1170
|
-
ellipsoid
|
|
1171
|
-
);
|
|
1172
|
-
if (cartesian) {
|
|
1173
|
-
if (circle == null) {
|
|
1174
|
-
// create the circle
|
|
1175
|
-
circle = new _.CirclePrimitive({
|
|
1176
|
-
center: cartesian,
|
|
1177
|
-
radius: 0,
|
|
1178
|
-
asynchronous: false,
|
|
1179
|
-
material: options.material,
|
|
1180
|
-
});
|
|
1181
|
-
primitives.add(circle);
|
|
1182
|
-
markers = new _.BillboardGroup(_self, defaultBillboard);
|
|
1183
|
-
markers.addBillboards([cartesian]);
|
|
1184
|
-
} else {
|
|
1185
|
-
if (typeof options.callback == 'function') {
|
|
1186
|
-
options.callback(circle.getCenter(), circle.getRadius());
|
|
1187
|
-
}
|
|
1188
|
-
_self.stopDrawing();
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
}
|
|
1192
|
-
}, Cesium.ScreenSpaceEventType.LEFT_DOWN);
|
|
1193
|
-
|
|
1194
|
-
mouseHandler.setInputAction(function (movement) {
|
|
1195
|
-
var position = movement.endPosition;
|
|
1196
|
-
if (position != null) {
|
|
1197
|
-
if (circle == null) {
|
|
1198
|
-
tooltip.showAt(position, '<p>Click to start drawing the circle</p>');
|
|
1199
|
-
} else {
|
|
1200
|
-
var cartesian = scene.camera.pickEllipsoid(position, ellipsoid);
|
|
1201
|
-
if (cartesian) {
|
|
1202
|
-
circle.setRadius(
|
|
1203
|
-
Cesium.Cartesian3.distance(circle.getCenter(), cartesian)
|
|
1204
|
-
);
|
|
1205
|
-
markers.updateBillboardsPositions(cartesian);
|
|
1206
|
-
tooltip.showAt(
|
|
1207
|
-
position,
|
|
1208
|
-
'<p>Move mouse to change circle radius</p><p>Click again to finish drawing</p>'
|
|
1209
|
-
);
|
|
1210
|
-
}
|
|
1211
|
-
}
|
|
1212
|
-
}
|
|
1213
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
1214
|
-
};
|
|
1215
|
-
|
|
1216
|
-
_.prototype.enhancePrimitives = function () {
|
|
1217
|
-
var drawHelper = this;
|
|
1218
|
-
|
|
1219
|
-
Cesium.Billboard.prototype.setEditable = function () {
|
|
1220
|
-
if (this._editable) {
|
|
1221
|
-
return;
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1224
|
-
this._editable = true;
|
|
1225
|
-
|
|
1226
|
-
var billboard = this;
|
|
1227
|
-
|
|
1228
|
-
var _self = this;
|
|
1229
|
-
|
|
1230
|
-
function enableRotation(enable) {
|
|
1231
|
-
drawHelper._scene.screenSpaceCameraController.enableRotate = enable;
|
|
1232
|
-
}
|
|
1233
|
-
|
|
1234
|
-
setListener(billboard, 'leftDown', function (position) {
|
|
1235
|
-
// TODO - start the drag handlers here
|
|
1236
|
-
// create handlers for mouseOut and leftUp for the billboard and a mouseMove
|
|
1237
|
-
function onDrag(position) {
|
|
1238
|
-
billboard.position = position;
|
|
1239
|
-
_self.executeListeners({ name: 'drag', positions: position });
|
|
1240
|
-
}
|
|
1241
|
-
function onDragEnd(position) {
|
|
1242
|
-
handler.destroy();
|
|
1243
|
-
enableRotation(true);
|
|
1244
|
-
_self.executeListeners({ name: 'dragEnd', positions: position });
|
|
1245
|
-
}
|
|
1246
|
-
|
|
1247
|
-
var handler = new Cesium.ScreenSpaceEventHandler(
|
|
1248
|
-
drawHelper._scene.canvas
|
|
1249
|
-
);
|
|
1250
|
-
|
|
1251
|
-
handler.setInputAction(function (movement) {
|
|
1252
|
-
var cartesian = drawHelper._scene.camera.pickEllipsoid(
|
|
1253
|
-
movement.endPosition,
|
|
1254
|
-
ellipsoid
|
|
1255
|
-
);
|
|
1256
|
-
if (cartesian) {
|
|
1257
|
-
onDrag(cartesian);
|
|
1258
|
-
} else {
|
|
1259
|
-
onDragEnd(cartesian);
|
|
1260
|
-
}
|
|
1261
|
-
}, Cesium.ScreenSpaceEventType.MOUSE_MOVE);
|
|
1262
|
-
|
|
1263
|
-
handler.setInputAction(function (movement) {
|
|
1264
|
-
onDragEnd(
|
|
1265
|
-
drawHelper._scene.camera.pickEllipsoid(movement.position, ellipsoid)
|
|
1266
|
-
);
|
|
1267
|
-
}, Cesium.ScreenSpaceEventType.LEFT_UP);
|
|
1268
|
-
|
|
1269
|
-
enableRotation(false);
|
|
1270
|
-
});
|
|
1271
|
-
|
|
1272
|
-
enhanceWithListeners(billboard);
|
|
1273
|
-
};
|
|
1274
|
-
|
|
1275
|
-
function setHighlighted(highlighted) {
|
|
1276
|
-
var scene = drawHelper._scene;
|
|
1277
|
-
|
|
1278
|
-
// if no change
|
|
1279
|
-
// if already highlighted, the outline polygon will be available
|
|
1280
|
-
if (this._highlighted && this._highlighted == highlighted) {
|
|
1281
|
-
return;
|
|
1282
|
-
}
|
|
1283
|
-
// disable if already in edit mode
|
|
1284
|
-
if (this._editMode === true) {
|
|
1285
|
-
return;
|
|
1286
|
-
}
|
|
1287
|
-
this._highlighted = highlighted;
|
|
1288
|
-
// highlight by creating an outline polygon matching the polygon points
|
|
1289
|
-
if (highlighted) {
|
|
1290
|
-
// make sure all other shapes are not highlighted
|
|
1291
|
-
drawHelper.setHighlighted(this);
|
|
1292
|
-
this._strokeColor = this.strokeColor;
|
|
1293
|
-
this.setStrokeStyle(
|
|
1294
|
-
Cesium.Color.fromCssColorString('white'),
|
|
1295
|
-
this.strokeWidth
|
|
1296
|
-
);
|
|
1297
|
-
} else {
|
|
1298
|
-
if (this._strokeColor) {
|
|
1299
|
-
this.setStrokeStyle(this._strokeColor, this.strokeWidth);
|
|
1300
|
-
} else {
|
|
1301
|
-
this.setStrokeStyle(undefined, undefined);
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
}
|
|
1305
|
-
|
|
1306
|
-
function setEditMode(editMode) {
|
|
1307
|
-
// if no change
|
|
1308
|
-
if (this._editMode == editMode) {
|
|
1309
|
-
return;
|
|
1310
|
-
}
|
|
1311
|
-
// make sure all other shapes are not in edit mode before starting the editing of this shape
|
|
1312
|
-
drawHelper.disableAllHighlights();
|
|
1313
|
-
// display markers
|
|
1314
|
-
if (editMode) {
|
|
1315
|
-
drawHelper.setEdited(this);
|
|
1316
|
-
var scene = drawHelper._scene;
|
|
1317
|
-
var _self = this;
|
|
1318
|
-
// create the markers and handlers for the editing
|
|
1319
|
-
if (this._markers == null) {
|
|
1320
|
-
var markers = new _.BillboardGroup(drawHelper, dragBillboard);
|
|
1321
|
-
var editMarkers = new _.BillboardGroup(drawHelper, dragHalfBillboard);
|
|
1322
|
-
// function for updating the edit markers around a certain point
|
|
1323
|
-
function updateHalfMarkers(index, positions) {
|
|
1324
|
-
// update the half markers before and after the index
|
|
1325
|
-
var editIndex = index - 1 < 0 ? positions.length - 1 : index - 1;
|
|
1326
|
-
if (editIndex < editMarkers.countBillboards()) {
|
|
1327
|
-
editMarkers.getBillboard(
|
|
1328
|
-
editIndex
|
|
1329
|
-
).position = calculateHalfMarkerPosition(editIndex);
|
|
1330
|
-
}
|
|
1331
|
-
editIndex = index;
|
|
1332
|
-
if (editIndex < editMarkers.countBillboards()) {
|
|
1333
|
-
editMarkers.getBillboard(
|
|
1334
|
-
editIndex
|
|
1335
|
-
).position = calculateHalfMarkerPosition(editIndex);
|
|
1336
|
-
}
|
|
1337
|
-
}
|
|
1338
|
-
function onEdited() {
|
|
1339
|
-
_self.executeListeners({
|
|
1340
|
-
name: 'onEdited',
|
|
1341
|
-
positions: _self.positions,
|
|
1342
|
-
});
|
|
1343
|
-
}
|
|
1344
|
-
var handleMarkerChanges = {
|
|
1345
|
-
dragHandlers: {
|
|
1346
|
-
onDrag: function (index, position) {
|
|
1347
|
-
_self.positions[index] = position;
|
|
1348
|
-
updateHalfMarkers(index, _self.positions);
|
|
1349
|
-
_self._createPrimitive = true;
|
|
1350
|
-
},
|
|
1351
|
-
onDragEnd: function (index, position) {
|
|
1352
|
-
_self._createPrimitive = true;
|
|
1353
|
-
onEdited();
|
|
1354
|
-
},
|
|
1355
|
-
},
|
|
1356
|
-
onDoubleClick: function (index) {
|
|
1357
|
-
if (_self.positions.length < 4) {
|
|
1358
|
-
return;
|
|
1359
|
-
}
|
|
1360
|
-
// remove the point and the corresponding markers
|
|
1361
|
-
_self.positions.splice(index, 1);
|
|
1362
|
-
_self._createPrimitive = true;
|
|
1363
|
-
markers.removeBillboard(index);
|
|
1364
|
-
editMarkers.removeBillboard(index);
|
|
1365
|
-
updateHalfMarkers(index, _self.positions);
|
|
1366
|
-
onEdited();
|
|
1367
|
-
},
|
|
1368
|
-
tooltip: function () {
|
|
1369
|
-
if (_self.positions.length > 3) {
|
|
1370
|
-
return 'Double click to remove this point';
|
|
1371
|
-
}
|
|
1372
|
-
},
|
|
1373
|
-
};
|
|
1374
|
-
// add billboards and keep an ordered list of them for the polygon edges
|
|
1375
|
-
markers.addBillboards(_self.positions, handleMarkerChanges);
|
|
1376
|
-
this._markers = markers;
|
|
1377
|
-
function calculateHalfMarkerPosition(index) {
|
|
1378
|
-
var positions = _self.positions;
|
|
1379
|
-
return ellipsoid.cartographicToCartesian(
|
|
1380
|
-
new Cesium.EllipsoidGeodesic(
|
|
1381
|
-
ellipsoid.cartesianToCartographic(positions[index]),
|
|
1382
|
-
ellipsoid.cartesianToCartographic(
|
|
1383
|
-
positions[index < positions.length - 1 ? index + 1 : 0]
|
|
1384
|
-
)
|
|
1385
|
-
).interpolateUsingFraction(0.5)
|
|
1386
|
-
);
|
|
1387
|
-
}
|
|
1388
|
-
var halfPositions = [];
|
|
1389
|
-
var index = 0;
|
|
1390
|
-
var length = _self.positions.length + (this.isPolygon ? 0 : -1);
|
|
1391
|
-
for (; index < length; index++) {
|
|
1392
|
-
halfPositions.push(calculateHalfMarkerPosition(index));
|
|
1393
|
-
}
|
|
1394
|
-
var handleEditMarkerChanges = {
|
|
1395
|
-
dragHandlers: {
|
|
1396
|
-
onDragStart: function (index, position) {
|
|
1397
|
-
// add a new position to the polygon but not a new marker yet
|
|
1398
|
-
this.index = index + 1;
|
|
1399
|
-
_self.positions.splice(this.index, 0, position);
|
|
1400
|
-
_self._createPrimitive = true;
|
|
1401
|
-
},
|
|
1402
|
-
onDrag: function (index, position) {
|
|
1403
|
-
_self.positions[this.index] = position;
|
|
1404
|
-
_self._createPrimitive = true;
|
|
1405
|
-
},
|
|
1406
|
-
onDragEnd: function (index, position) {
|
|
1407
|
-
// create new sets of makers for editing
|
|
1408
|
-
markers.insertBillboard(
|
|
1409
|
-
this.index,
|
|
1410
|
-
position,
|
|
1411
|
-
handleMarkerChanges
|
|
1412
|
-
);
|
|
1413
|
-
editMarkers.getBillboard(
|
|
1414
|
-
this.index - 1
|
|
1415
|
-
).position = calculateHalfMarkerPosition(this.index - 1);
|
|
1416
|
-
editMarkers.insertBillboard(
|
|
1417
|
-
this.index,
|
|
1418
|
-
calculateHalfMarkerPosition(this.index),
|
|
1419
|
-
handleEditMarkerChanges
|
|
1420
|
-
);
|
|
1421
|
-
_self._createPrimitive = true;
|
|
1422
|
-
onEdited();
|
|
1423
|
-
},
|
|
1424
|
-
},
|
|
1425
|
-
tooltip: function () {
|
|
1426
|
-
return 'Drag to create a new point';
|
|
1427
|
-
},
|
|
1428
|
-
};
|
|
1429
|
-
editMarkers.addBillboards(halfPositions, handleEditMarkerChanges);
|
|
1430
|
-
this._editMarkers = editMarkers;
|
|
1431
|
-
// add a handler for clicking in the globe
|
|
1432
|
-
this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(
|
|
1433
|
-
scene.canvas
|
|
1434
|
-
);
|
|
1435
|
-
this._globeClickhandler.setInputAction(function (movement) {
|
|
1436
|
-
var pickedObject = scene.pick(movement.position);
|
|
1437
|
-
if (!(pickedObject && pickedObject.primitive)) {
|
|
1438
|
-
_self.setEditMode(false);
|
|
1439
|
-
}
|
|
1440
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
1441
|
-
|
|
1442
|
-
// set on top of the polygon
|
|
1443
|
-
markers.setOnTop();
|
|
1444
|
-
editMarkers.setOnTop();
|
|
1445
|
-
}
|
|
1446
|
-
this._editMode = true;
|
|
1447
|
-
} else {
|
|
1448
|
-
if (this._markers != null) {
|
|
1449
|
-
this._markers.remove();
|
|
1450
|
-
this._editMarkers.remove();
|
|
1451
|
-
this._markers = null;
|
|
1452
|
-
this._editMarkers = null;
|
|
1453
|
-
this._globeClickhandler.destroy();
|
|
1454
|
-
}
|
|
1455
|
-
this._editMode = false;
|
|
1456
|
-
}
|
|
1457
|
-
}
|
|
1458
|
-
|
|
1459
|
-
DrawHelper.PolylinePrimitive.prototype.setEditable = function () {
|
|
1460
|
-
if (this.setEditMode) {
|
|
1461
|
-
return;
|
|
1462
|
-
}
|
|
1463
|
-
|
|
1464
|
-
var polyline = this;
|
|
1465
|
-
polyline.isPolygon = false;
|
|
1466
|
-
polyline.asynchronous = false;
|
|
1467
|
-
|
|
1468
|
-
drawHelper.registerEditableShape(polyline);
|
|
1469
|
-
|
|
1470
|
-
polyline.setEditMode = setEditMode;
|
|
1471
|
-
|
|
1472
|
-
var originalWidth = this.width;
|
|
1473
|
-
|
|
1474
|
-
polyline.setHighlighted = function (highlighted) {
|
|
1475
|
-
// disable if already in edit mode
|
|
1476
|
-
if (this._editMode === true) {
|
|
1477
|
-
return;
|
|
1478
|
-
}
|
|
1479
|
-
if (highlighted) {
|
|
1480
|
-
drawHelper.setHighlighted(this);
|
|
1481
|
-
this.setWidth(originalWidth * 2);
|
|
1482
|
-
} else {
|
|
1483
|
-
this.setWidth(originalWidth);
|
|
1484
|
-
}
|
|
1485
|
-
};
|
|
1486
|
-
|
|
1487
|
-
polyline.getExtent = function () {
|
|
1488
|
-
return Cesium.Extent.fromCartographicArray(
|
|
1489
|
-
ellipsoid.cartesianArrayToCartographicArray(this.positions)
|
|
1490
|
-
);
|
|
1491
|
-
};
|
|
1492
|
-
|
|
1493
|
-
enhanceWithListeners(polyline);
|
|
1494
|
-
|
|
1495
|
-
polyline.setEditMode(false);
|
|
1496
|
-
};
|
|
1497
|
-
|
|
1498
|
-
DrawHelper.PolygonPrimitive.prototype.setEditable = function () {
|
|
1499
|
-
var polygon = this;
|
|
1500
|
-
polygon.asynchronous = false;
|
|
1501
|
-
|
|
1502
|
-
var scene = drawHelper._scene;
|
|
1503
|
-
|
|
1504
|
-
drawHelper.registerEditableShape(polygon);
|
|
1505
|
-
|
|
1506
|
-
polygon.setEditMode = setEditMode;
|
|
1507
|
-
|
|
1508
|
-
polygon.setHighlighted = setHighlighted;
|
|
1509
|
-
|
|
1510
|
-
enhanceWithListeners(polygon);
|
|
1511
|
-
|
|
1512
|
-
polygon.setEditMode(false);
|
|
1513
|
-
};
|
|
1514
|
-
|
|
1515
|
-
DrawHelper.ExtentPrimitive.prototype.setEditable = function () {
|
|
1516
|
-
if (this.setEditMode) {
|
|
1517
|
-
return;
|
|
1518
|
-
}
|
|
1519
|
-
|
|
1520
|
-
var extent = this;
|
|
1521
|
-
var scene = drawHelper._scene;
|
|
1522
|
-
|
|
1523
|
-
drawHelper.registerEditableShape(extent);
|
|
1524
|
-
extent.asynchronous = false;
|
|
1525
|
-
|
|
1526
|
-
extent.setEditMode = function (editMode) {
|
|
1527
|
-
// if no change
|
|
1528
|
-
if (this._editMode == editMode) {
|
|
1529
|
-
return;
|
|
1530
|
-
}
|
|
1531
|
-
drawHelper.disableAllHighlights();
|
|
1532
|
-
// display markers
|
|
1533
|
-
if (editMode) {
|
|
1534
|
-
// make sure all other shapes are not in edit mode before starting the editing of this shape
|
|
1535
|
-
drawHelper.setEdited(this);
|
|
1536
|
-
// create the markers and handlers for the editing
|
|
1537
|
-
if (this._markers == null) {
|
|
1538
|
-
var markers = new _.BillboardGroup(drawHelper, dragBillboard);
|
|
1539
|
-
function onEdited() {
|
|
1540
|
-
extent.executeListeners({
|
|
1541
|
-
name: 'onEdited',
|
|
1542
|
-
extent: extent.extent,
|
|
1543
|
-
});
|
|
1544
|
-
}
|
|
1545
|
-
var handleMarkerChanges = {
|
|
1546
|
-
dragHandlers: {
|
|
1547
|
-
onDrag: function (index, position) {
|
|
1548
|
-
var corner = markers.getBillboard((index + 2) % 4).position;
|
|
1549
|
-
extent.setExtent(
|
|
1550
|
-
getExtent(
|
|
1551
|
-
ellipsoid.cartesianToCartographic(corner),
|
|
1552
|
-
ellipsoid.cartesianToCartographic(position)
|
|
1553
|
-
)
|
|
1554
|
-
);
|
|
1555
|
-
markers.updateBillboardsPositions(
|
|
1556
|
-
getExtentCorners(extent.extent)
|
|
1557
|
-
);
|
|
1558
|
-
},
|
|
1559
|
-
onDragEnd: function (index, position) {
|
|
1560
|
-
onEdited();
|
|
1561
|
-
},
|
|
1562
|
-
},
|
|
1563
|
-
tooltip: function () {
|
|
1564
|
-
return 'Drag to change the corners of this extent';
|
|
1565
|
-
},
|
|
1566
|
-
};
|
|
1567
|
-
markers.addBillboards(
|
|
1568
|
-
getExtentCorners(extent.extent),
|
|
1569
|
-
handleMarkerChanges
|
|
1570
|
-
);
|
|
1571
|
-
this._markers = markers;
|
|
1572
|
-
// add a handler for clicking in the globe
|
|
1573
|
-
this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(
|
|
1574
|
-
scene.canvas
|
|
1575
|
-
);
|
|
1576
|
-
this._globeClickhandler.setInputAction(function (movement) {
|
|
1577
|
-
var pickedObject = scene.pick(movement.position);
|
|
1578
|
-
// disable edit if pickedobject is different or not an object
|
|
1579
|
-
if (
|
|
1580
|
-
!(
|
|
1581
|
-
pickedObject &&
|
|
1582
|
-
!pickedObject.isDestroyed() &&
|
|
1583
|
-
pickedObject.primitive
|
|
1584
|
-
)
|
|
1585
|
-
) {
|
|
1586
|
-
extent.setEditMode(false);
|
|
1587
|
-
}
|
|
1588
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
1589
|
-
|
|
1590
|
-
// set on top of the polygon
|
|
1591
|
-
markers.setOnTop();
|
|
1592
|
-
}
|
|
1593
|
-
this._editMode = true;
|
|
1594
|
-
} else {
|
|
1595
|
-
if (this._markers != null) {
|
|
1596
|
-
this._markers.remove();
|
|
1597
|
-
this._markers = null;
|
|
1598
|
-
this._globeClickhandler.destroy();
|
|
1599
|
-
}
|
|
1600
|
-
this._editMode = false;
|
|
1601
|
-
}
|
|
1602
|
-
};
|
|
1603
|
-
|
|
1604
|
-
extent.setHighlighted = setHighlighted;
|
|
1605
|
-
|
|
1606
|
-
enhanceWithListeners(extent);
|
|
1607
|
-
|
|
1608
|
-
extent.setEditMode(false);
|
|
1609
|
-
};
|
|
1610
|
-
|
|
1611
|
-
_.EllipsePrimitive.prototype.setEditable = function () {
|
|
1612
|
-
if (this.setEditMode) {
|
|
1613
|
-
return;
|
|
1614
|
-
}
|
|
1615
|
-
|
|
1616
|
-
var ellipse = this;
|
|
1617
|
-
var scene = drawHelper._scene;
|
|
1618
|
-
|
|
1619
|
-
ellipse.asynchronous = false;
|
|
1620
|
-
|
|
1621
|
-
drawHelper.registerEditableShape(ellipse);
|
|
1622
|
-
|
|
1623
|
-
ellipse.setEditMode = function (editMode) {
|
|
1624
|
-
// if no change
|
|
1625
|
-
if (this._editMode == editMode) {
|
|
1626
|
-
return;
|
|
1627
|
-
}
|
|
1628
|
-
drawHelper.disableAllHighlights();
|
|
1629
|
-
// display markers
|
|
1630
|
-
if (editMode) {
|
|
1631
|
-
// make sure all other shapes are not in edit mode before starting the editing of this shape
|
|
1632
|
-
drawHelper.setEdited(this);
|
|
1633
|
-
var _self = this;
|
|
1634
|
-
// create the markers and handlers for the editing
|
|
1635
|
-
if (this._markers == null) {
|
|
1636
|
-
var markers = new _.BillboardGroup(drawHelper, dragBillboard);
|
|
1637
|
-
function getMarkerPositions() {
|
|
1638
|
-
return Cesium.Shapes.computeEllipseBoundary(
|
|
1639
|
-
ellipsoid,
|
|
1640
|
-
ellipse.getCenter(),
|
|
1641
|
-
ellipse.getSemiMajorAxis(),
|
|
1642
|
-
ellipse.getSemiMinorAxis(),
|
|
1643
|
-
ellipse.getRotation() + Math.PI / 2,
|
|
1644
|
-
Math.PI / 2.0
|
|
1645
|
-
).splice(0, 4);
|
|
1646
|
-
}
|
|
1647
|
-
function onEdited() {
|
|
1648
|
-
ellipse.executeListeners({
|
|
1649
|
-
name: 'onEdited',
|
|
1650
|
-
center: ellipse.getCenter(),
|
|
1651
|
-
semiMajorAxis: ellipse.getSemiMajorAxis(),
|
|
1652
|
-
semiMinorAxis: ellipse.getSemiMinorAxis(),
|
|
1653
|
-
rotation: 0,
|
|
1654
|
-
});
|
|
1655
|
-
}
|
|
1656
|
-
var handleMarkerChanges = {
|
|
1657
|
-
dragHandlers: {
|
|
1658
|
-
onDrag: function (index, position) {
|
|
1659
|
-
var distance = Cesium.Cartesian3.distance(
|
|
1660
|
-
ellipse.getCenter(),
|
|
1661
|
-
position
|
|
1662
|
-
);
|
|
1663
|
-
if (index % 2 == 0) {
|
|
1664
|
-
ellipse.setSemiMajorAxis(distance);
|
|
1665
|
-
} else {
|
|
1666
|
-
ellipse.setSemiMinorAxis(distance);
|
|
1667
|
-
}
|
|
1668
|
-
markers.updateBillboardsPositions(getMarkerPositions());
|
|
1669
|
-
},
|
|
1670
|
-
onDragEnd: function (index, position) {
|
|
1671
|
-
onEdited();
|
|
1672
|
-
},
|
|
1673
|
-
},
|
|
1674
|
-
tooltip: function () {
|
|
1675
|
-
return 'Drag to change the excentricity and radius';
|
|
1676
|
-
},
|
|
1677
|
-
};
|
|
1678
|
-
markers.addBillboards(getMarkerPositions(), handleMarkerChanges);
|
|
1679
|
-
this._markers = markers;
|
|
1680
|
-
// add a handler for clicking in the globe
|
|
1681
|
-
this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(
|
|
1682
|
-
scene.canvas
|
|
1683
|
-
);
|
|
1684
|
-
this._globeClickhandler.setInputAction(function (movement) {
|
|
1685
|
-
var pickedObject = scene.pick(movement.position);
|
|
1686
|
-
if (!(pickedObject && pickedObject.primitive)) {
|
|
1687
|
-
_self.setEditMode(false);
|
|
1688
|
-
}
|
|
1689
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
1690
|
-
|
|
1691
|
-
// set on top of the polygon
|
|
1692
|
-
markers.setOnTop();
|
|
1693
|
-
}
|
|
1694
|
-
this._editMode = true;
|
|
1695
|
-
} else {
|
|
1696
|
-
if (this._markers != null) {
|
|
1697
|
-
this._markers.remove();
|
|
1698
|
-
this._markers = null;
|
|
1699
|
-
this._globeClickhandler.destroy();
|
|
1700
|
-
}
|
|
1701
|
-
this._editMode = false;
|
|
1702
|
-
}
|
|
1703
|
-
};
|
|
1704
|
-
|
|
1705
|
-
ellipse.setHighlighted = setHighlighted;
|
|
1706
|
-
|
|
1707
|
-
enhanceWithListeners(ellipse);
|
|
1708
|
-
|
|
1709
|
-
ellipse.setEditMode(false);
|
|
1710
|
-
};
|
|
1711
|
-
|
|
1712
|
-
_.CirclePrimitive.prototype.getCircleCartesianCoordinates = function (
|
|
1713
|
-
granularity
|
|
1714
|
-
) {
|
|
1715
|
-
var geometry = Cesium.CircleOutlineGeometry.createGeometry(
|
|
1716
|
-
new Cesium.CircleOutlineGeometry({
|
|
1717
|
-
ellipsoid: ellipsoid,
|
|
1718
|
-
center: this.getCenter(),
|
|
1719
|
-
radius: this.getRadius(),
|
|
1720
|
-
granularity: granularity,
|
|
1721
|
-
})
|
|
1722
|
-
);
|
|
1723
|
-
var count = 0,
|
|
1724
|
-
value,
|
|
1725
|
-
values = [];
|
|
1726
|
-
for (; count < geometry.attributes.position.values.length; count += 3) {
|
|
1727
|
-
value = geometry.attributes.position.values;
|
|
1728
|
-
values.push(
|
|
1729
|
-
new Cesium.Cartesian3(
|
|
1730
|
-
value[count],
|
|
1731
|
-
value[count + 1],
|
|
1732
|
-
value[count + 2]
|
|
1733
|
-
)
|
|
1734
|
-
);
|
|
1735
|
-
}
|
|
1736
|
-
return values;
|
|
1737
|
-
};
|
|
1738
|
-
|
|
1739
|
-
_.CirclePrimitive.prototype.setEditable = function () {
|
|
1740
|
-
if (this.setEditMode) {
|
|
1741
|
-
return;
|
|
1742
|
-
}
|
|
1743
|
-
|
|
1744
|
-
var circle = this;
|
|
1745
|
-
var scene = drawHelper._scene;
|
|
1746
|
-
|
|
1747
|
-
circle.asynchronous = false;
|
|
1748
|
-
|
|
1749
|
-
drawHelper.registerEditableShape(circle);
|
|
1750
|
-
|
|
1751
|
-
circle.setEditMode = function (editMode) {
|
|
1752
|
-
// if no change
|
|
1753
|
-
if (this._editMode == editMode) {
|
|
1754
|
-
return;
|
|
1755
|
-
}
|
|
1756
|
-
drawHelper.disableAllHighlights();
|
|
1757
|
-
// display markers
|
|
1758
|
-
if (editMode) {
|
|
1759
|
-
// make sure all other shapes are not in edit mode before starting the editing of this shape
|
|
1760
|
-
drawHelper.setEdited(this);
|
|
1761
|
-
var _self = this;
|
|
1762
|
-
// create the markers and handlers for the editing
|
|
1763
|
-
if (this._markers == null) {
|
|
1764
|
-
var markers = new _.BillboardGroup(drawHelper, dragBillboard);
|
|
1765
|
-
function getMarkerPositions() {
|
|
1766
|
-
return _self.getCircleCartesianCoordinates(
|
|
1767
|
-
Cesium.Math.PI_OVER_TWO
|
|
1768
|
-
);
|
|
1769
|
-
}
|
|
1770
|
-
function onEdited() {
|
|
1771
|
-
circle.executeListeners({
|
|
1772
|
-
name: 'onEdited',
|
|
1773
|
-
center: circle.getCenter(),
|
|
1774
|
-
radius: circle.getRadius(),
|
|
1775
|
-
});
|
|
1776
|
-
}
|
|
1777
|
-
var handleMarkerChanges = {
|
|
1778
|
-
dragHandlers: {
|
|
1779
|
-
onDrag: function (index, position) {
|
|
1780
|
-
circle.setRadius(
|
|
1781
|
-
Cesium.Cartesian3.distance(circle.getCenter(), position)
|
|
1782
|
-
);
|
|
1783
|
-
markers.updateBillboardsPositions(getMarkerPositions());
|
|
1784
|
-
},
|
|
1785
|
-
onDragEnd: function (index, position) {
|
|
1786
|
-
onEdited();
|
|
1787
|
-
},
|
|
1788
|
-
},
|
|
1789
|
-
tooltip: function () {
|
|
1790
|
-
return 'Drag to change the radius';
|
|
1791
|
-
},
|
|
1792
|
-
};
|
|
1793
|
-
markers.addBillboards(getMarkerPositions(), handleMarkerChanges);
|
|
1794
|
-
this._markers = markers;
|
|
1795
|
-
// add a handler for clicking in the globe
|
|
1796
|
-
this._globeClickhandler = new Cesium.ScreenSpaceEventHandler(
|
|
1797
|
-
scene.canvas
|
|
1798
|
-
);
|
|
1799
|
-
this._globeClickhandler.setInputAction(function (movement) {
|
|
1800
|
-
var pickedObject = scene.pick(movement.position);
|
|
1801
|
-
if (!(pickedObject && pickedObject.primitive)) {
|
|
1802
|
-
_self.setEditMode(false);
|
|
1803
|
-
}
|
|
1804
|
-
}, Cesium.ScreenSpaceEventType.LEFT_CLICK);
|
|
1805
|
-
|
|
1806
|
-
// set on top of the polygon
|
|
1807
|
-
markers.setOnTop();
|
|
1808
|
-
}
|
|
1809
|
-
this._editMode = true;
|
|
1810
|
-
} else {
|
|
1811
|
-
if (this._markers != null) {
|
|
1812
|
-
this._markers.remove();
|
|
1813
|
-
this._markers = null;
|
|
1814
|
-
this._globeClickhandler.destroy();
|
|
1815
|
-
}
|
|
1816
|
-
this._editMode = false;
|
|
1817
|
-
}
|
|
1818
|
-
};
|
|
1819
|
-
|
|
1820
|
-
circle.setHighlighted = setHighlighted;
|
|
1821
|
-
|
|
1822
|
-
enhanceWithListeners(circle);
|
|
1823
|
-
|
|
1824
|
-
circle.setEditMode(false);
|
|
1825
|
-
};
|
|
1826
|
-
};
|
|
1827
|
-
|
|
1828
|
-
_.DrawHelperWidget = (function () {
|
|
1829
|
-
// constructor
|
|
1830
|
-
function _(drawHelper, options) {
|
|
1831
|
-
// container must be specified
|
|
1832
|
-
if (!Cesium.defined(options.container)) {
|
|
1833
|
-
throw new Cesium.DeveloperError('Container is required');
|
|
1834
|
-
}
|
|
1835
|
-
|
|
1836
|
-
var drawOptions = {
|
|
1837
|
-
markerIcon: './assets/img/glyphicons_242_google_maps.png',
|
|
1838
|
-
polylineIcon: './assets/img/glyphicons_097_vector_path_line.png',
|
|
1839
|
-
polygonIcon: './assets/img/glyphicons_096_vector_path_polygon.png',
|
|
1840
|
-
circleIcon: './assets/img/glyphicons_095_vector_path_circle.png',
|
|
1841
|
-
extentIcon: './assets/img/glyphicons_094_vector_path_square.png',
|
|
1842
|
-
clearIcon: './assets/img/glyphicons_067_cleaning.png',
|
|
1843
|
-
polylineDrawingOptions: defaultPolylineOptions,
|
|
1844
|
-
polygonDrawingOptions: defaultPolygonOptions,
|
|
1845
|
-
extentDrawingOptions: defaultExtentOptions,
|
|
1846
|
-
circleDrawingOptions: defaultCircleOptions,
|
|
1847
|
-
};
|
|
1848
|
-
|
|
1849
|
-
fillOptions(options, drawOptions);
|
|
1850
|
-
|
|
1851
|
-
var _self = this;
|
|
1852
|
-
|
|
1853
|
-
var toolbar = document.createElement('DIV');
|
|
1854
|
-
toolbar.className = 'toolbar';
|
|
1855
|
-
options.container.appendChild(toolbar);
|
|
1856
|
-
|
|
1857
|
-
function addIcon(id, url, title, callback) {
|
|
1858
|
-
var div = document.createElement('DIV');
|
|
1859
|
-
div.className = 'button';
|
|
1860
|
-
div.title = title;
|
|
1861
|
-
toolbar.appendChild(div);
|
|
1862
|
-
div.onclick = callback;
|
|
1863
|
-
var span = document.createElement('SPAN');
|
|
1864
|
-
div.appendChild(span);
|
|
1865
|
-
var image = document.createElement('IMG');
|
|
1866
|
-
image.src = url;
|
|
1867
|
-
span.appendChild(image);
|
|
1868
|
-
return div;
|
|
1869
|
-
}
|
|
1870
|
-
|
|
1871
|
-
var scene = drawHelper._scene;
|
|
1872
|
-
|
|
1873
|
-
addIcon(
|
|
1874
|
-
'marker',
|
|
1875
|
-
options.markerIcon,
|
|
1876
|
-
'Click to start drawing a 2D marker',
|
|
1877
|
-
function () {
|
|
1878
|
-
drawHelper.startDrawingMarker({
|
|
1879
|
-
callback: function (position) {
|
|
1880
|
-
_self.executeListeners({
|
|
1881
|
-
name: 'markerCreated',
|
|
1882
|
-
position: position,
|
|
1883
|
-
});
|
|
1884
|
-
},
|
|
1885
|
-
});
|
|
1886
|
-
}
|
|
1887
|
-
);
|
|
1888
|
-
|
|
1889
|
-
addIcon(
|
|
1890
|
-
'polyline',
|
|
1891
|
-
options.polylineIcon,
|
|
1892
|
-
'Click to start drawing a 2D polyline',
|
|
1893
|
-
function () {
|
|
1894
|
-
drawHelper.startDrawingPolyline({
|
|
1895
|
-
callback: function (positions) {
|
|
1896
|
-
_self.executeListeners({
|
|
1897
|
-
name: 'polylineCreated',
|
|
1898
|
-
positions: positions,
|
|
1899
|
-
});
|
|
1900
|
-
},
|
|
1901
|
-
});
|
|
1902
|
-
}
|
|
1903
|
-
);
|
|
1904
|
-
|
|
1905
|
-
addIcon(
|
|
1906
|
-
'polygon',
|
|
1907
|
-
options.polygonIcon,
|
|
1908
|
-
'Click to start drawing a 2D polygon',
|
|
1909
|
-
function () {
|
|
1910
|
-
drawHelper.startDrawingPolygon({
|
|
1911
|
-
callback: function (positions) {
|
|
1912
|
-
_self.executeListeners({
|
|
1913
|
-
name: 'polygonCreated',
|
|
1914
|
-
positions: positions,
|
|
1915
|
-
});
|
|
1916
|
-
},
|
|
1917
|
-
});
|
|
1918
|
-
}
|
|
1919
|
-
);
|
|
1920
|
-
|
|
1921
|
-
addIcon(
|
|
1922
|
-
'extent',
|
|
1923
|
-
options.extentIcon,
|
|
1924
|
-
'Click to start drawing an Extent',
|
|
1925
|
-
function () {
|
|
1926
|
-
drawHelper.startDrawingExtent({
|
|
1927
|
-
callback: function (extent) {
|
|
1928
|
-
_self.executeListeners({ name: 'extentCreated', extent: extent });
|
|
1929
|
-
},
|
|
1930
|
-
});
|
|
1931
|
-
}
|
|
1932
|
-
);
|
|
1933
|
-
|
|
1934
|
-
addIcon(
|
|
1935
|
-
'circle',
|
|
1936
|
-
options.circleIcon,
|
|
1937
|
-
'Click to start drawing a Circle',
|
|
1938
|
-
function () {
|
|
1939
|
-
drawHelper.startDrawingCircle({
|
|
1940
|
-
callback: function (center, radius) {
|
|
1941
|
-
_self.executeListeners({
|
|
1942
|
-
name: 'circleCreated',
|
|
1943
|
-
center: center,
|
|
1944
|
-
radius: radius,
|
|
1945
|
-
});
|
|
1946
|
-
},
|
|
1947
|
-
});
|
|
1948
|
-
}
|
|
1949
|
-
);
|
|
1950
|
-
|
|
1951
|
-
// add a clear button at the end
|
|
1952
|
-
// add a divider first
|
|
1953
|
-
var div = document.createElement('DIV');
|
|
1954
|
-
div.className = 'divider';
|
|
1955
|
-
toolbar.appendChild(div);
|
|
1956
|
-
addIcon('clear', options.clearIcon, 'Remove all primitives', function () {
|
|
1957
|
-
scene.primitives.removeAll();
|
|
1958
|
-
});
|
|
1959
|
-
|
|
1960
|
-
enhanceWithListeners(this);
|
|
1961
|
-
}
|
|
1962
|
-
|
|
1963
|
-
return _;
|
|
1964
|
-
})();
|
|
1965
|
-
|
|
1966
|
-
_.prototype.addToolbar = function (container, options) {
|
|
1967
|
-
options = copyOptions(options, { container: container });
|
|
1968
|
-
return new _.DrawHelperWidget(this, options);
|
|
1969
|
-
};
|
|
1970
|
-
|
|
1971
|
-
function getExtent(mn, mx) {
|
|
1972
|
-
var e = new Cesium.Rectangle();
|
|
1973
|
-
|
|
1974
|
-
// Re-order so west < east and south < north
|
|
1975
|
-
e.west = Math.min(mn.longitude, mx.longitude);
|
|
1976
|
-
e.east = Math.max(mn.longitude, mx.longitude);
|
|
1977
|
-
e.south = Math.min(mn.latitude, mx.latitude);
|
|
1978
|
-
e.north = Math.max(mn.latitude, mx.latitude);
|
|
1979
|
-
|
|
1980
|
-
// Check for approx equal (shouldn't require abs due to re-order)
|
|
1981
|
-
var epsilon = Cesium.Math.EPSILON7;
|
|
1982
|
-
|
|
1983
|
-
if (e.east - e.west < epsilon) {
|
|
1984
|
-
e.east += epsilon * 2.0;
|
|
1985
|
-
}
|
|
1986
|
-
|
|
1987
|
-
if (e.north - e.south < epsilon) {
|
|
1988
|
-
e.north += epsilon * 2.0;
|
|
1989
|
-
}
|
|
1990
|
-
|
|
1991
|
-
return e;
|
|
1992
|
-
}
|
|
1993
|
-
|
|
1994
|
-
function createTooltip(frameDiv) {
|
|
1995
|
-
var tooltip = function (frameDiv) {
|
|
1996
|
-
var div = document.createElement('DIV');
|
|
1997
|
-
div.className = 'twipsy right';
|
|
1998
|
-
|
|
1999
|
-
var arrow = document.createElement('DIV');
|
|
2000
|
-
arrow.className = 'twipsy-arrow';
|
|
2001
|
-
div.appendChild(arrow);
|
|
2002
|
-
|
|
2003
|
-
var title = document.createElement('DIV');
|
|
2004
|
-
title.className = 'twipsy-inner';
|
|
2005
|
-
div.appendChild(title);
|
|
2006
|
-
|
|
2007
|
-
this._div = div;
|
|
2008
|
-
this._title = title;
|
|
2009
|
-
|
|
2010
|
-
// add to frame div and display coordinates
|
|
2011
|
-
frameDiv.appendChild(div);
|
|
2012
|
-
};
|
|
2013
|
-
|
|
2014
|
-
tooltip.prototype.setVisible = function (visible) {
|
|
2015
|
-
this._div.style.display = visible ? 'block' : 'none';
|
|
2016
|
-
};
|
|
2017
|
-
|
|
2018
|
-
tooltip.prototype.showAt = function (position, message) {
|
|
2019
|
-
if (position && message) {
|
|
2020
|
-
this.setVisible(true);
|
|
2021
|
-
this._title.innerHTML = message;
|
|
2022
|
-
this._div.style.left = position.x + 10 + 'px';
|
|
2023
|
-
this._div.style.top = position.y - this._div.clientHeight / 2 + 'px';
|
|
2024
|
-
}
|
|
2025
|
-
};
|
|
2026
|
-
|
|
2027
|
-
return new tooltip(frameDiv);
|
|
2028
|
-
}
|
|
2029
|
-
|
|
2030
|
-
function getDisplayLatLngString(cartographic, precision) {
|
|
2031
|
-
return (
|
|
2032
|
-
cartographic.longitude.toFixed(precision || 3) +
|
|
2033
|
-
', ' +
|
|
2034
|
-
cartographic.latitude.toFixed(precision || 3)
|
|
2035
|
-
);
|
|
2036
|
-
}
|
|
2037
|
-
|
|
2038
|
-
function clone(from, to) {
|
|
2039
|
-
if (from == null || typeof from != 'object') return from;
|
|
2040
|
-
if (from.constructor != Object && from.constructor != Array) return from;
|
|
2041
|
-
if (
|
|
2042
|
-
from.constructor == Date ||
|
|
2043
|
-
from.constructor == RegExp ||
|
|
2044
|
-
from.constructor == Function ||
|
|
2045
|
-
from.constructor == String ||
|
|
2046
|
-
from.constructor == Number ||
|
|
2047
|
-
from.constructor == Boolean
|
|
2048
|
-
)
|
|
2049
|
-
return new from.constructor(from);
|
|
2050
|
-
|
|
2051
|
-
to = to || new from.constructor();
|
|
2052
|
-
|
|
2053
|
-
for (var name in from) {
|
|
2054
|
-
to[name] =
|
|
2055
|
-
typeof to[name] == 'undefined' ? clone(from[name], null) : to[name];
|
|
2056
|
-
}
|
|
2057
|
-
|
|
2058
|
-
return to;
|
|
2059
|
-
}
|
|
2060
|
-
|
|
2061
|
-
function fillOptions(options, defaultOptions) {
|
|
2062
|
-
options = options || {};
|
|
2063
|
-
var option;
|
|
2064
|
-
for (option in defaultOptions) {
|
|
2065
|
-
if (options[option] === undefined) {
|
|
2066
|
-
options[option] = clone(defaultOptions[option]);
|
|
2067
|
-
}
|
|
2068
|
-
}
|
|
2069
|
-
}
|
|
2070
|
-
|
|
2071
|
-
// shallow copy
|
|
2072
|
-
function copyOptions(options, defaultOptions) {
|
|
2073
|
-
var newOptions = clone(options),
|
|
2074
|
-
option;
|
|
2075
|
-
for (option in defaultOptions) {
|
|
2076
|
-
if (newOptions[option] === undefined) {
|
|
2077
|
-
newOptions[option] = clone(defaultOptions[option]);
|
|
2078
|
-
}
|
|
2079
|
-
}
|
|
2080
|
-
return newOptions;
|
|
2081
|
-
}
|
|
2082
|
-
|
|
2083
|
-
function setListener(primitive, type, callback) {
|
|
2084
|
-
primitive[type] = callback;
|
|
2085
|
-
}
|
|
2086
|
-
|
|
2087
|
-
function enhanceWithListeners(element) {
|
|
2088
|
-
element._listeners = {};
|
|
2089
|
-
|
|
2090
|
-
element.addListener = function (name, callback) {
|
|
2091
|
-
this._listeners[name] = this._listeners[name] || [];
|
|
2092
|
-
this._listeners[name].push(callback);
|
|
2093
|
-
return this._listeners[name].length;
|
|
2094
|
-
};
|
|
2095
|
-
|
|
2096
|
-
element.executeListeners = function (event, defaultCallback) {
|
|
2097
|
-
if (
|
|
2098
|
-
this._listeners[event.name] &&
|
|
2099
|
-
this._listeners[event.name].length > 0
|
|
2100
|
-
) {
|
|
2101
|
-
var index = 0;
|
|
2102
|
-
for (; index < this._listeners[event.name].length; index++) {
|
|
2103
|
-
this._listeners[event.name][index](event);
|
|
2104
|
-
}
|
|
2105
|
-
} else {
|
|
2106
|
-
if (defaultCallback) {
|
|
2107
|
-
defaultCallback(event);
|
|
2108
|
-
}
|
|
2109
|
-
}
|
|
2110
|
-
};
|
|
2111
|
-
}
|
|
2112
|
-
|
|
2113
|
-
return _;
|
|
2114
|
-
})();
|
|
2115
|
-
|
|
2116
|
-
export { DrawHelper };
|