]> ToastFreeware Gitweb - philipp/winterrodeln/mediawiki_extensions/wrmap.git/blobdiff - src/wrmap.ts
Rename "properties" of geojson to "wr_properties".
[philipp/winterrodeln/mediawiki_extensions/wrmap.git] / src / wrmap.ts
index 7e720bf15d4dd25a3c5ee4221f1258bd64bd84f1..7cec3e29fb81eb411e7e5db493426e59a6dcee7f 100644 (file)
@@ -273,14 +273,11 @@ function init_wrmap(_: number, jq_map_element: HTMLElement) {
 
        // map itself
        // ----------
-       let lon = json_js.properties.lon;
-       let lat = json_js.properties.lat;
-       let zoom = json_js.properties.zoom;
-       let width = json_js.properties.width;
-       let height = json_js.properties.height;
-       if (zoom === undefined) zoom = 10; // default zoom
-       if (width === undefined) width = '100%'; // default width
-       if (height === undefined) height = 450;  // default: 450 pixel
+       let lon = json_js.wr_properties?.lon ?? 11.;
+       let lat = json_js.wr_properties?.lat ?? 47.;
+       let zoom = json_js.wr_properties?.zoom ?? 10;
+       let width = json_js.wr_properties?.width ?? '100%';
+       let height = json_js.properties?.height ?? 450;
        jq_map.width(width);
        jq_map.height(height);