sctj-components 1.0.58 → 1.0.60

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.
@@ -5031,7 +5031,7 @@ const _sfc_main$6 = {
5031
5031
  };
5032
5032
  }
5033
5033
  };
5034
- const index_vue_vue_type_style_index_0_scoped_976b8061_lang = "";
5034
+ const index_vue_vue_type_style_index_0_scoped_ae15bc12_lang = "";
5035
5035
  const _hoisted_1$4 = { class: "action-container" };
5036
5036
  const _hoisted_2$3 = {
5037
5037
  key: 0,
@@ -5096,15 +5096,45 @@ const _sfc_main$5 = {
5096
5096
  type: String,
5097
5097
  default: "",
5098
5098
  required: true
5099
+ },
5100
+ showControlbar: {
5101
+ type: Boolean,
5102
+ default: true
5103
+ },
5104
+ showToolBar: {
5105
+ type: Boolean,
5106
+ default: true
5107
+ },
5108
+ showMapType: {
5109
+ type: Boolean,
5110
+ default: true
5111
+ },
5112
+ controlsPosition: {
5113
+ type: Object,
5114
+ default: () => {
5115
+ return {
5116
+ bottom: "10px",
5117
+ right: "10px"
5118
+ };
5119
+ }
5099
5120
  }
5100
5121
  },
5101
5122
  emits: ["loaded", "overlay-click", "overlay-mouseover", "overlay-mouseout"],
5102
5123
  setup(__props, { expose, emit }) {
5103
5124
  const props = __props;
5104
5125
  useCssVars((_ctx) => ({
5105
- "7481e673": __props.width,
5106
- "01ebee1a": __props.height
5126
+ "3fd21866": __props.width,
5127
+ "bebc0af2": __props.height
5107
5128
  }));
5129
+ const controlsPositionVars = computed$1(() => {
5130
+ const position = props.controlsPosition || {};
5131
+ const cssVars = {};
5132
+ Object.entries(position).forEach(([key, value]) => {
5133
+ const cssKey = key.replace(/([A-Z])/g, "-$1").toLowerCase();
5134
+ cssVars[`--controls-${cssKey}`] = value;
5135
+ });
5136
+ return cssVars;
5137
+ });
5108
5138
  const mapContainer = ref$1(null);
5109
5139
  const map = shallowRef(null);
5110
5140
  const legend = ref$1([]);
@@ -5372,41 +5402,41 @@ const _sfc_main$5 = {
5372
5402
  satelliteLayer.value = new AMap2.TileLayer.Satellite({
5373
5403
  zIndex: 1
5374
5404
  });
5375
- if (props.viewMode === "3D") {
5376
- if (!controlBar.value) {
5377
- controlBar.value = new AMap2.ControlBar({
5378
- position: {
5379
- bottom: "10px",
5380
- right: "10px"
5381
- }
5382
- });
5383
- map.value.addControl(controlBar.value);
5384
- }
5385
- }
5386
- if (!toolBar.value) {
5387
- toolBar.value = new AMap2.ToolBar({
5388
- position: {
5389
- top: "25px",
5390
- left: "20px"
5391
- }
5392
- });
5393
- map.value.addControl(toolBar.value);
5394
- }
5395
- if (!mapType.value) {
5396
- mapType.value = new AMap2.MapType({
5397
- defaultType: 0,
5398
- position: {
5399
- bottom: "120px",
5400
- left: "100px"
5401
- }
5402
- });
5403
- map.value.addControl(mapType.value);
5404
- }
5405
+ setMapControls();
5405
5406
  state.currentZoom = map.value.getZoom();
5406
5407
  } catch (error) {
5407
5408
  console.error("Failed to load AMap:", error);
5408
5409
  }
5409
5410
  };
5411
+ const setMapControls = () => {
5412
+ if (props.showToolBar && !toolBar.value) {
5413
+ toolBar.value = new AMap.ToolBar({
5414
+ position: {
5415
+ top: "initial",
5416
+ left: "initial"
5417
+ }
5418
+ });
5419
+ map.value.addControl(toolBar.value);
5420
+ }
5421
+ if (props.showControlbar && !controlBar.value) {
5422
+ controlBar.value = new AMap.ControlBar({
5423
+ position: {
5424
+ top: "initial",
5425
+ left: "initial"
5426
+ }
5427
+ });
5428
+ map.value.addControl(controlBar.value);
5429
+ }
5430
+ if (props.showMapType && !mapType.value) {
5431
+ mapType.value = new AMap.MapType({
5432
+ position: {
5433
+ top: "initial",
5434
+ left: "initial"
5435
+ }
5436
+ });
5437
+ map.value.addControl(mapType.value);
5438
+ }
5439
+ };
5410
5440
  const parsePosition = (position) => {
5411
5441
  if (typeof position === "string" && position.includes(",")) {
5412
5442
  return position.split(",").map(Number);
@@ -5948,7 +5978,8 @@ const _sfc_main$5 = {
5948
5978
  class: "mapViewContainer",
5949
5979
  id: "mapContainer",
5950
5980
  ref_key: "mapContainer",
5951
- ref: mapContainer
5981
+ ref: mapContainer,
5982
+ style: normalizeStyle(unref(controlsPositionVars))
5952
5983
  }, [
5953
5984
  createElementVNode("div", _hoisted_1$4, [
5954
5985
  __props.legendConfig.length ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
@@ -5974,11 +6005,11 @@ const _sfc_main$5 = {
5974
6005
  }, 8, ["modelValue"])
5975
6006
  ])) : createCommentVNode("", true)
5976
6007
  ])
5977
- ], 512);
6008
+ ], 4);
5978
6009
  };
5979
6010
  }
5980
6011
  };
5981
- const SCTJMapViewer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-976b8061"]]);
6012
+ const SCTJMapViewer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-ae15bc12"]]);
5982
6013
  const index_vue_vue_type_style_index_0_scoped_761d2ab4_lang = "";
5983
6014
  const _withScopeId$2 = (n) => (pushScopeId("data-v-761d2ab4"), n = n(), popScopeId(), n);
5984
6015
  const _hoisted_1$3 = {