diff --git a/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java b/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java new file mode 100644 index 0000000000..740ccd72b2 --- /dev/null +++ b/designer-chart/src/main/java/com/fanruan/map/DesignGEOJSONHelper.java @@ -0,0 +1,36 @@ +package com.fanruan.map; + +import com.fr.decision.webservice.v10.map.geojson.MapDataType; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONUtils; +import com.fr.log.FineLoggerFactory; +import com.fr.third.org.apache.commons.lang3.time.StopWatch; +import com.fr.workspace.server.repository.map.MapRepository; + +/** + * 设计器地图资源Helper + * + * @author Destiny.Lin + * @since 11.0 + * Created on 2024/9/27 + */ +public class DesignGEOJSONHelper extends GEOJSONHelper { + + @Override + protected void init() { + try { + + StopWatch watch = new StopWatch(); + watch.start(); + URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.GEOGRAPHIC))); + URL_JSON_MAP.putAll(MapRepository.getInstance().getMapResource(GEOJSONUtils.getMapDataTypePath(MapDataType.IMAGE))); + + FineLoggerFactory.getLogger().info("Load chart map resources spend time {} ms", watch.getTime()); + watch.stop(); + + } catch (Exception e) { + FineLoggerFactory.getLogger().error(e.getMessage(), e); + } + } + +} diff --git a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java index 3a41a04c13..daf742e338 100644 --- a/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java +++ b/designer-realize/src/main/java/com/fanruan/boot/env/function/DesignChartBaseComponent.java @@ -1,11 +1,14 @@ package com.fanruan.boot.env.function; import com.fanruan.boot.ChartBaseComponent; +import com.fanruan.carina.Carina; import com.fanruan.carina.annotions.DependsOn; import com.fanruan.carina.annotions.FineComponent; import com.fanruan.carina.annotions.Start; import com.fanruan.carina.annotions.Stop; import com.fanruan.carina.annotions.Supplemental; +import com.fanruan.map.DesignGEOJSONHelper; +import com.fr.decision.webservice.v10.map.geojson.helper.GEOJSONHelperShell; /** @@ -42,6 +45,7 @@ public class DesignChartBaseComponent extends ChartBaseComponent { @Supplemental public void prepare() { super.prepare(); + Carina.getApplicationContext().singleton(GEOJSONHelperShell.class).set(DesignGEOJSONHelper.class); } }