// 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);
$json = array(
'type' => 'FeatureCollection',
'features' => $json_features,
- 'properties' => $properties
+ 'wr_properties' => $properties
);
$json_string = json_encode($json);