InitMap.js 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. import Map from '@arcgis/core/Map'
  2. import MapView from '@arcgis/core/views/MapView'
  3. import SceneView from '@arcgis/core/views/SceneView'
  4. import dojoConfig from '../../config/tsconfig.json'
  5. class InitMap{
  6. constructor(options) {
  7. this.m_map = options.m_map;
  8. this.m_view = options.m_view;
  9. this.m_spatialReference = options.m_spatialReference;
  10. this.intMap()
  11. }
  12. intMap(){
  13. this.m_map = new Map({});
  14. this.m_map.ground.navigationConstraint = {
  15. type: "none"
  16. };
  17. this.m_view = new SceneView({
  18. container:"viewDiv",
  19. map:this.m_map,
  20. logo:false,
  21. viewingMode:"global",
  22. scale:dojoConfig["scale"],
  23. spatialReference:this.m_spatialReference,
  24. qualityProfile:"high",
  25. environment: {
  26. starsEnabled: false,
  27. atmosphereEnabled: true, //大气层
  28. weather: {
  29. type: "sunny",
  30. cloudCover: 0.7,
  31. precipitation: 0.3
  32. },
  33. atmosphere: {
  34. quality: "high"
  35. },
  36. lighting: {
  37. date: new Date().setHours(-3),
  38. directShadowsEnabled: true,
  39. cameraTrackingEnabled: true
  40. }
  41. }
  42. });
  43. this.m_view.constraints = {
  44. collision: {
  45. enabled: false
  46. }
  47. };
  48. this.m_view.ui.empty("top-left");
  49. this.m_view.ui.remove("attribution");
  50. }
  51. }
  52. export default InitMap