map-config.js 3.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. // const _normalUrl = "http://115.91.94.42:8080/MAPDATA/YONGIN/Base/{z}/{x}/{y}.png";
  2. // const _satelliteUrl = "http://115.91.94.42:8080/MAPDATA/YONGIN/Satellite/{z}/{x}/{y}.jpeg";
  3. // const _hybridUrl = "http://115.91.94.42:8080/MAPDATA/YONGIN/Hybrid/{z}/{x}/{y}.png";
  4. const _normalUrl = "/MAPDATA/YONGIN/Base/{z}/{x}/{y}.png";
  5. const _satelliteUrl = "/MAPDATA/YONGIN/Satellite/{z}/{x}/{y}.jpeg";
  6. const _hybridUrl = "/MAPDATA/YONGIN/Hybrid/{z}/{x}/{y}.png";
  7. export class TMapConfig {
  8. constructor() {
  9. this.mapCenter = [127.109873, 37.283203];
  10. this.mapDefZoom = 14;
  11. this.mapMinZoom = 10;
  12. this.mapMaxZoom = 18;
  13. this.mapView = new ol.View({
  14. center: this.mapCenter,
  15. zoom: this.mapDefZoom,
  16. projection: "EPSG:4326",
  17. minZoom: this.mapMinZoom,
  18. maxZoom: this.mapMaxZoom,
  19. constrainResolution: true, // force zooming to a integer zoom
  20. });
  21. this.poiGroup = new ol.layer.Group({
  22. title: "시설물",
  23. visible: true,
  24. layers: [],
  25. });
  26. this.eventGroup = new ol.layer.Group({
  27. title: "이벤트",
  28. visible: false,
  29. layers: [],
  30. });
  31. this.trafGroup = new ol.layer.Group({
  32. title: "소통정보",
  33. visible: true,
  34. layers: [],
  35. });
  36. this.baseMapLyr = {
  37. normal: new ol.layer.Group({
  38. title: "일반",
  39. visible: true,
  40. layers: [
  41. new ol.layer.WebGLTile({
  42. source: new ol.source.XYZ({
  43. //attributions: ["©Vworld"],
  44. opaque: false,
  45. crossOrigin: "anonymous",
  46. url: _normalUrl,
  47. }),
  48. name: "normal",
  49. }),
  50. ],
  51. }),
  52. satellite: new ol.layer.Group({
  53. title: "위성+하이브리드",
  54. visible: false,
  55. layers: [
  56. new ol.layer.WebGLTile({
  57. source: new ol.source.XYZ({
  58. //attributions: ["©Vworld"],
  59. opaque: false,
  60. crossOrigin: "anonymous",
  61. url: _satelliteUrl,
  62. }),
  63. name: "satellite",
  64. }),
  65. new ol.layer.WebGLTile({
  66. source: new ol.source.XYZ({
  67. //attributions: ["©Vworld"],
  68. opaque: false,
  69. crossOrigin: "anonymous",
  70. url: _hybridUrl,
  71. }),
  72. name: "hybrid",
  73. }),
  74. ],
  75. }),
  76. };
  77. this.baseMapGroup = new ol.layer.Group({
  78. title: "배경지도",
  79. visible: true,
  80. layers: [this.baseMapLyr.normal, this.baseMapLyr.satellite],
  81. });
  82. }
  83. }