sctj-components 1.0.58 → 1.0.59

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_8c2ed7f7_lang = "";
5035
5035
  const _hoisted_1$4 = { class: "action-container" };
5036
5036
  const _hoisted_2$3 = {
5037
5037
  key: 0,
@@ -5096,14 +5096,26 @@ 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
5099
5111
  }
5100
5112
  },
5101
5113
  emits: ["loaded", "overlay-click", "overlay-mouseover", "overlay-mouseout"],
5102
5114
  setup(__props, { expose, emit }) {
5103
5115
  const props = __props;
5104
5116
  useCssVars((_ctx) => ({
5105
- "7481e673": __props.width,
5106
- "01ebee1a": __props.height
5117
+ "abb75a64": __props.width,
5118
+ "fed1e5c2": __props.height
5107
5119
  }));
5108
5120
  const mapContainer = ref$1(null);
5109
5121
  const map = shallowRef(null);
@@ -5372,41 +5384,41 @@ const _sfc_main$5 = {
5372
5384
  satelliteLayer.value = new AMap2.TileLayer.Satellite({
5373
5385
  zIndex: 1
5374
5386
  });
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
- }
5387
+ setMapControls();
5405
5388
  state.currentZoom = map.value.getZoom();
5406
5389
  } catch (error) {
5407
5390
  console.error("Failed to load AMap:", error);
5408
5391
  }
5409
5392
  };
5393
+ const setMapControls = () => {
5394
+ if (props.showToolBar && !toolBar.value) {
5395
+ toolBar.value = new AMap.ToolBar({
5396
+ position: {
5397
+ top: "initial",
5398
+ left: "initial"
5399
+ }
5400
+ });
5401
+ map.value.addControl(toolBar.value);
5402
+ }
5403
+ if (props.showControlbar && !controlBar.value) {
5404
+ controlBar.value = new AMap.ControlBar({
5405
+ position: {
5406
+ top: "initial",
5407
+ left: "initial"
5408
+ }
5409
+ });
5410
+ map.value.addControl(controlBar.value);
5411
+ }
5412
+ if (props.showMapType && !mapType.value) {
5413
+ mapType.value = new AMap.MapType({
5414
+ position: {
5415
+ top: "initial",
5416
+ left: "initial"
5417
+ }
5418
+ });
5419
+ map.value.addControl(mapType.value);
5420
+ }
5421
+ };
5410
5422
  const parsePosition = (position) => {
5411
5423
  if (typeof position === "string" && position.includes(",")) {
5412
5424
  return position.split(",").map(Number);
@@ -5978,7 +5990,7 @@ const _sfc_main$5 = {
5978
5990
  };
5979
5991
  }
5980
5992
  };
5981
- const SCTJMapViewer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-976b8061"]]);
5993
+ const SCTJMapViewer = /* @__PURE__ */ _export_sfc(_sfc_main$5, [["__scopeId", "data-v-8c2ed7f7"]]);
5982
5994
  const index_vue_vue_type_style_index_0_scoped_761d2ab4_lang = "";
5983
5995
  const _withScopeId$2 = (n) => (pushScopeId("data-v-761d2ab4"), n = n(), popScopeId(), n);
5984
5996
  const _hoisted_1$3 = {