Skip to content

Commit

Permalink
CADENZA-37531 and CADENZA-38242: (#70)
Browse files Browse the repository at this point in the history
* CADENZA-37531 and CADENZA-38242:
- Renaming of zoomTarget to extentStrategy
- Define additionalLayers only once in the sandbox and reuse it everywhere needed

* CADENZA-37531 and CADENZA-38242:
- Reformat examples for extentStrategy in the sandbox to make copying easier

* CADENZA-37531 and CADENZA-38242:
- Remove "Added" phrase from the "Added" section topics
  • Loading branch information
klschm authored Nov 25, 2024
1 parent 9a50d1c commit 915cb2e
Show file tree
Hide file tree
Showing 3 changed files with 164 additions and 212 deletions.
7 changes: 5 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,13 @@ This project uses a version scheme based on the Cadenza main version in the form
## Unreleased
### Added
- `additionalLayers` option for `CadenzaClient#showMap`
- `LayerDataExtentZoomTarget`, `LocationFinderZoomTarget` and `StaticZoomTarget` added
- Added the 'ZoomTarget' also to the sandbox
- `LayerDataExtentStrategy`, `LocationFinderExtentStrategy` and `StaticExtentStrategy`
- "Extent Strategy" also to the sandbox
- Improved sandbox 'additionalLayers' and 'geometry' examples

### Changed
- **BREAKING CHANGE** Renamed `zoomTarget` parameter, `ZoomTarget` type and `GeometryZoomTarget` type to `extentStrategy`, `ExtentStrategy` and `GeometryExtentStrategy`

### Deprecated
- The optional zooming parameters `locationFinder` and `mapExtent` in `CadenzaClient#showMap`, `CadenzaClient#createGeometry` and `CadenzaClient#editGeometry`

Expand Down
229 changes: 89 additions & 140 deletions sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@
simplifiedOperationMode,
useMapSrs,
fullGeometries,
zoomTarget,
extentStrategy,
distance,
lengthUnit,
additionalLayers
Expand All @@ -250,7 +250,7 @@
layers: layers ? JSON.parse(layers) : undefined,
useMapSrs: useMapSrs === 'on',
fullGeometries: fullGeometries === 'on',
zoomTarget: zoomTarget && JSON.parse(zoomTarget),
extentStrategy: extentStrategy && JSON.parse(extentStrategy),
buffer: distance ? { value: Number(distance), lengthUnit: lengthUnit ? lengthUnit : 'm' } : undefined,
additionalLayers: additionalLayers && JSON.parse(additionalLayers)
};
Expand Down Expand Up @@ -458,66 +458,11 @@
</div>
</template>

<template data-action="showMap" data-common="zoomTarget,map,showWorkbook,disabledUiFeatures,filter,show">
<template data-action="showMap" data-common="additionalLayers,extentStrategy,map,showWorkbook,disabledUiFeatures,filter,show">
<div>
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
<input name="embeddingTargetId" id="embeddingTargetId" required>
</div>
<div>
<label for="geometry">Additional layers (GeoJSON)</label>
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
<small>
<strong>Example:</strong>
<pre>
[
{
"type":"geojson",
"name":"freiburg",
"content":{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{},
"geometry":{
"coordinates":[
[
[7.965977481550681,47.93787211649922],
[7.903787681150362,47.64741821336713],
[8.310793134690243,47.70344757260733],
[7.965977481550681,47.93787211649922]
]
],
"type":"Polygon"
}
}
]
}
}
]
</pre>
</small>
</div>
<div>
<label for="geometry">Geometry (GeoJSON)</label>
<textarea name="geometry" id="geometry" rows="5"></textarea>
<small>
<strong>Example:</strong>
<pre>
{
"coordinates":[
[
[9.598504509838506,52.70992820638244],
[8.899110702389294,51.72257425885121],
[10.906499617840836,51.725944168909365],
[9.598504509838506,52.70992820638244]
]
],
"type":"Polygon"
}
</pre>
</small>
</div>
</template>

<template data-action="setCustomValidity">
Expand All @@ -536,46 +481,11 @@

<template data-action="setFilter" data-common="filter"></template>

<template data-action="createGeometry" data-common="zoomTarget,map,disabledUiFeatures,filter">
<template data-action="createGeometry" data-common="additionalLayers,extentStrategy,map,disabledUiFeatures,filter">
<div>
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
<input name="embeddingTargetId" id="embeddingTargetId" required>
</div>
<div>
<label for="geometry">Additional layers (GeoJSON)</label>
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
<small>
<strong>Example:</strong>
<pre>
[
{
"type":"geojson",
"name":"freiburg",
"content":{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{},
"geometry":{
"coordinates":[
[
[7.965977481550681,47.93787211649922],
[7.903787681150362,47.64741821336713],
[8.310793134690243,47.70344757260733],
[7.965977481550681,47.93787211649922]
]
],
"type":"Polygon"
}
}
]
}
}
]
</pre>
</small>
</div>
<div>
<label for="geometryType">Geometry type</label>
<select name="geometryType" id="geometryType">
Expand All @@ -599,46 +509,11 @@
</div>
</template>

<template data-action="editGeometry" data-common="zoomTarget,map,disabledUiFeatures,filter">
<template data-action="editGeometry" data-common="extentStrategy,map,disabledUiFeatures,filter">
<div>
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
<input name="embeddingTargetId" id="embeddingTargetId" required>
</div>
<div>
<label for="geometry">Additional layers (GeoJSON)</label>
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
<small>
<strong>Example:</strong>
<pre>
[
{
"type":"geojson",
"name":"freiburg",
"content":{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{},
"geometry":{
"coordinates":[
[
[7.965977481550681,47.93787211649922],
[7.903787681150362,47.64741821336713],
[8.310793134690243,47.70344757260733],
[7.965977481550681,47.93787211649922]
]
],
"type":"Polygon"
}
}
]
}
}
]
</pre>
</small>
</div>
<div>
<label for="geometry">Geometry (GeoJSON) *</label>
<textarea name="geometry" id="geometry" rows="5" required></textarea>
Expand Down Expand Up @@ -671,7 +546,7 @@
</div>
</template>

<template data-action="selectObjects" data-common="zoomTarget,map,filter">
<template data-action="selectObjects" data-common="extentStrategy,map,filter">
<div>
<label for="embeddingTargetId">Embedding target ID of the map view *</label>
<input name="embeddingTargetId" id="embeddingTargetId" required>
Expand Down Expand Up @@ -740,10 +615,68 @@
</div>
</template>

<template id="common-zoomTarget">
<template id="common-additionalLayers">
<div>
<label for="zoomTarget">Zoom Target</label>
<textarea name="zoomTarget" id="zoomTarget" rows="5"></textarea>
<label for="geometry">Additional layers (GeoJSON)</label>
<textarea name="additionalLayers" id="additionalLayers" rows="10"></textarea>
<small>
<strong>Example:</strong>
<pre>
[
{
"type":"geojson",
"name":"freiburg",
"content":{
"type":"FeatureCollection",
"features":[
{
"type":"Feature",
"properties":{},
"geometry":{
"coordinates":[
[
[7.965977481550681,47.93787211649922],
[7.903787681150362,47.64741821336713],
[8.310793134690243,47.70344757260733],
[7.965977481550681,47.93787211649922]
]
],
"type":"Polygon"
}
}
]
}
}
]
</pre>
</small>
</div>
<div>
<label for="geometry">Geometry (GeoJSON)</label>
<textarea name="geometry" id="geometry" rows="5"></textarea>
<small>
<strong>Example:</strong>
<pre>
{
"coordinates":[
[
[9.598504509838506,52.70992820638244],
[8.899110702389294,51.72257425885121],
[10.906499617840836,51.725944168909365],
[9.598504509838506,52.70992820638244]
]
],
"type":"Polygon"
}
</pre>
</small>
</div>
</template>

<template id="common-extentStrategy">
<div>
<label for="extentStrategy">Extent Strategy</label>
<textarea name="extentStrategy" id="extentStrategy" rows="5"></textarea>
<small>
<p>Optional JSON Object</p>
<p>
Expand All @@ -754,13 +687,29 @@
</ul>
</p>
<p>
Supported zoomTargets as examples to use:
Supported extent strategies as examples to use:
<ul>
<li>{"type": "geometry", "geometry": {"coordinates":[[[9.598504509838506,52.70992820638244],[8.899110702389294,51.72257425885121],[10.906499617840836,51.725944168909365],[9.598504509838506,52.70992820638244]]],"type":"Polygon"}}</li>
<li>{"type": "locationFinder", "query": "Hamburg"}</li>
<li>{"type": "static", "extent": [9.585571,53.38169,10.483704,53.859007]}</li>
<li>{"type": "layerDataExtent"}</li>
<li>{"type": "layerDataExtent", "layers": ["Messstellen", "Gewässer"]}</li>
<li><pre>{
"type": "geometry",
"geometry": {
"coordinates":[[
[9.598504509838506,52.70992820638244],
[8.899110702389294,51.72257425885121],
[10.906499617840836,51.725944168909365],
[9.598504509838506,52.70992820638244]]],
"type":"Polygon"
}
}</pre></li>
<li><pre>{"type": "locationFinder", "query": "Hamburg"}</pre></li>
<li><pre>{
"type": "static",
"extent": [9.585571,53.38169,10.483704,53.859007]
}</pre></li>
<li><pre>{"type": "layerData"}</pre></li>
<li><pre>{
"type": "layerData",
"layers": ["Messstellen", "Gewässer"]
}</pre></li>
</ul>
</p>
</small>
Expand Down
Loading

0 comments on commit 915cb2e

Please sign in to comment.