@opengeoweb/webmap-react 12.4.2 → 12.5.0
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.
package/index.esm.js
CHANGED
|
@@ -3062,7 +3062,9 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
3062
3062
|
onLayerReady = layerProps.onLayerReady,
|
|
3063
3063
|
onLayerError = layerProps.onLayerError,
|
|
3064
3064
|
debugMode = layerProps.debugMode,
|
|
3065
|
-
layerType = layerProps.layerType
|
|
3065
|
+
layerType = layerProps.layerType,
|
|
3066
|
+
_layerProps$tileServe = layerProps.tileServerSettings,
|
|
3067
|
+
tileServerSettings = _layerProps$tileServe === void 0 ? tilesettings : _layerProps$tileServe;
|
|
3066
3068
|
var isBaseLayer = layerType === LayerType.baseLayer;
|
|
3067
3069
|
var isOverlay = layerType === LayerType.overLayer;
|
|
3068
3070
|
var layerOptions = useMemo(function () {
|
|
@@ -3097,46 +3099,42 @@ var OpenLayersLayer = function OpenLayersLayer(layerProps) {
|
|
|
3097
3099
|
tileServer = layerProps.tileServer;
|
|
3098
3100
|
if (type === 'twms' && _name) {
|
|
3099
3101
|
var _map$getView;
|
|
3100
|
-
var tileSettingByName =
|
|
3102
|
+
var tileSettingByName = tileServerSettings[_name] || tileServer && tileServer[_name];
|
|
3101
3103
|
if (!tileSettingByName) {
|
|
3102
|
-
console.warn("Tilesetting with name ".concat(_name, " not found in "),
|
|
3104
|
+
console.warn("Tilesetting with name ".concat(_name, " not found in "), tileServerSettings, tileServer);
|
|
3103
3105
|
}
|
|
3104
3106
|
var projectionName = map === null || map === void 0 || (_map$getView = map.getView()) === null || _map$getView === void 0 || (_map$getView = _map$getView.getProjection()) === null || _map$getView === void 0 ? void 0 : _map$getView.getCode();
|
|
3105
3107
|
var projectionUsedFromTileServer = tileSettingByName[projectionName] ? projectionName : 'EPSG:3857';
|
|
3106
3108
|
var tileSettingForCRS = tileSettingByName && projectionName && tileSettingByName[projectionUsedFromTileServer];
|
|
3107
3109
|
if (tileSettingForCRS) {
|
|
3108
3110
|
var home = tileSettingForCRS.home,
|
|
3109
|
-
tileServerType = tileSettingForCRS.tileServerType
|
|
3110
|
-
|
|
3111
|
-
|
|
3112
|
-
|
|
3113
|
-
|
|
3114
|
-
|
|
3115
|
-
|
|
3116
|
-
|
|
3117
|
-
|
|
3118
|
-
|
|
3119
|
-
|
|
3120
|
-
|
|
3121
|
-
|
|
3122
|
-
|
|
3123
|
-
|
|
3124
|
-
layerProps: _objectSpread2(_objectSpread2({}, layerProps), {}, {
|
|
3125
|
-
enabled: true
|
|
3126
|
-
}),
|
|
3127
|
-
tileProjectionCode: projectionUsedFromTileServer
|
|
3128
|
-
});
|
|
3111
|
+
tileServerType = tileSettingForCRS.tileServerType,
|
|
3112
|
+
urlTemplateOverride = tileSettingForCRS.urlTemplate;
|
|
3113
|
+
var urlTemplate = (urlTemplateOverride === null || urlTemplateOverride === void 0 ? void 0 : urlTemplateOverride(home)) || '';
|
|
3114
|
+
if (!urlTemplateOverride) {
|
|
3115
|
+
switch (tileServerType) {
|
|
3116
|
+
case 'arcgisonline':
|
|
3117
|
+
urlTemplate = "".concat(home, "{z}/{y}/{x}.png");
|
|
3118
|
+
break;
|
|
3119
|
+
case 'osm':
|
|
3120
|
+
urlTemplate = "".concat(home, "{z}/{x}/{y}.png");
|
|
3121
|
+
break;
|
|
3122
|
+
case 'wmst':
|
|
3123
|
+
urlTemplate = "".concat(home, "{z}/{y}/{x}");
|
|
3124
|
+
break;
|
|
3125
|
+
}
|
|
3129
3126
|
}
|
|
3130
|
-
if (
|
|
3131
|
-
|
|
3132
|
-
urlTemplate: "".concat(home, "{z}/{y}/{x}"),
|
|
3133
|
-
layerOptions: layerOptions,
|
|
3134
|
-
layerProps: _objectSpread2(_objectSpread2({}, layerProps), {}, {
|
|
3135
|
-
enabled: true
|
|
3136
|
-
}),
|
|
3137
|
-
tileProjectionCode: projectionUsedFromTileServer
|
|
3138
|
-
});
|
|
3127
|
+
if (!urlTemplate) {
|
|
3128
|
+
console.warn("Tile server type ".concat(tileServerType, " not supported"), tileServerSettings, tileServer);
|
|
3139
3129
|
}
|
|
3130
|
+
return jsx(XYZLayer, {
|
|
3131
|
+
urlTemplate: urlTemplate,
|
|
3132
|
+
layerOptions: layerOptions,
|
|
3133
|
+
layerProps: _objectSpread2(_objectSpread2({}, layerProps), {}, {
|
|
3134
|
+
enabled: true
|
|
3135
|
+
}),
|
|
3136
|
+
tileProjectionCode: projectionUsedFromTileServer
|
|
3137
|
+
});
|
|
3140
3138
|
}
|
|
3141
3139
|
} else if (_name && _service) {
|
|
3142
3140
|
return jsx(WMSLayer, {
|
|
@@ -11687,7 +11685,8 @@ var FEATURE_EDR_HOVER = [new Style$1({
|
|
|
11687
11685
|
})];
|
|
11688
11686
|
var FEATURE_MY_LOCATION = new Style$1({
|
|
11689
11687
|
renderer: function renderer(pixelCoordinates, state) {
|
|
11690
|
-
var ctx = state.context
|
|
11688
|
+
var ctx = state.context,
|
|
11689
|
+
pixelRatio = state.pixelRatio;
|
|
11691
11690
|
var coord = pixelCoordinates;
|
|
11692
11691
|
ctx.save();
|
|
11693
11692
|
// Draw outer circle with shadow
|
|
@@ -11696,13 +11695,13 @@ var FEATURE_MY_LOCATION = new Style$1({
|
|
|
11696
11695
|
ctx.shadowColor = '#00000080';
|
|
11697
11696
|
ctx.shadowBlur = 10;
|
|
11698
11697
|
ctx.beginPath();
|
|
11699
|
-
ctx.arc(coord[0], coord[1],
|
|
11698
|
+
ctx.arc(coord[0], coord[1], 12 * pixelRatio, 0, 2 * Math.PI);
|
|
11700
11699
|
ctx.fill();
|
|
11701
11700
|
ctx.shadowBlur = 0;
|
|
11702
11701
|
// Draw inner circle
|
|
11703
11702
|
ctx.fillStyle = '#186dff';
|
|
11704
11703
|
ctx.beginPath();
|
|
11705
|
-
ctx.arc(coord[0], coord[1],
|
|
11704
|
+
ctx.arc(coord[0], coord[1], 9 * pixelRatio, 0, 2 * Math.PI);
|
|
11706
11705
|
ctx.fill();
|
|
11707
11706
|
// Reset transformations
|
|
11708
11707
|
ctx.restore();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@opengeoweb/webmap-react",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.5.0",
|
|
4
4
|
"description": "GeoWeb react wrapper for webmap",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -8,10 +8,10 @@
|
|
|
8
8
|
"url": "git@gitlab.com:opengeoweb/opengeoweb.git"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@opengeoweb/webmap": "12.
|
|
11
|
+
"@opengeoweb/webmap": "12.5.0",
|
|
12
12
|
"axios": "^1.7.7",
|
|
13
|
-
"@opengeoweb/theme": "12.
|
|
14
|
-
"@opengeoweb/shared": "12.
|
|
13
|
+
"@opengeoweb/theme": "12.5.0",
|
|
14
|
+
"@opengeoweb/shared": "12.5.0",
|
|
15
15
|
"lodash": "^4.17.21",
|
|
16
16
|
"ol": "^10.4.0",
|
|
17
17
|
"proj4": "^2.9.2",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { LayerFoundation } from '@opengeoweb/webmap';
|
|
1
|
+
import { LayerFoundation, TileServerSettings } from '@opengeoweb/webmap';
|
|
2
2
|
import type { OnInitializeLayerProps } from '../utils/types';
|
|
3
3
|
import { DrawModeExitCallback, FeatureEvent } from '../../MapDraw';
|
|
4
4
|
export interface OpenLayersLayerProps extends LayerFoundation {
|
|
@@ -15,5 +15,6 @@ export interface OpenLayersLayerProps extends LayerFoundation {
|
|
|
15
15
|
selectedFeatureIndex?: number;
|
|
16
16
|
onClickFeature?: (event?: FeatureEvent) => void;
|
|
17
17
|
onHoverFeature?: (event: FeatureEvent) => void;
|
|
18
|
+
tileServerSettings?: TileServerSettings;
|
|
18
19
|
}
|
|
19
20
|
export declare const OpenLayersLayer: (layerProps: OpenLayersLayerProps) => React.ReactElement;
|