Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CADENZA-38130 Feat: adding additionalLayers param to showMap API #69

Merged
merged 2 commits into from
Nov 22, 2024

Conversation

ivigilm
Copy link
Contributor

@ivigilm ivigilm commented Nov 21, 2024

No description provided.

sandbox.html Outdated
@@ -474,9 +474,33 @@
<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" placeholder="featureCollections array"></textarea>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These placeholders are not helpful, they just duplicate the labels. I'd remove them.

}
]}
}]
</small>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These examples are hard to read in the sandbox, because there are no line breaks and indentation. Proposal:

    <small>
      <strong>Example:</strong>
      <pre>
[
  {
    "type":"geojson",
    "name":"Freiburg",
    "content": {
      "type": "FeatureCollection",
      "features": [ ... ]
    }
  }
  ...
]</pre>
    </small>

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the examples are really lengthy? Do we really need all the info, which makes the sidebar rather long? After all it's only an example.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klaus wanted to have the possibility for people to easily copy paste and use it in the input, so for that we need everything, yes. Is this a problem? it's only a few pixels more.

"coordinates":[[[9.598504509838506,52.70992820638244],[8.899110702389294,51.72257425885121],[10.906499617840836,51.725944168909365],[9.598504509838506,52.70992820638244]]],
"type":"Polygon"
}
</small>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

    <small>
      <strong>Example:</strong>
      <pre>
{
  "type":"Polygon",
  "coordinates": [ [ 9.599, 52.71 ], ... ]
}</pre>
    </small>

@@ -437,6 +439,11 @@ export class CadenzaClient {
zoomToGeometry,
});
}
if (additionalLayers) {
additionalLayers.forEach((layer) =>
this.#postEvent('importLayer', layer),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Klaus changes this to a request, please coordinate this change with him.

sandbox.html Outdated
@@ -503,7 +527,21 @@
</div>
<div>
<label for="geometry">Additional layers (GeoJSON)</label>
<textarea name="additionalLayers" id="additionalLayers" rows="10" placeholder="[ { type: &quot;geojson&quot;, name: &quot;Stuttgart&quot;, content: { &quot;type&quot;: &quot;FeatureCollection&quot;, &quot;features&quot;: [ { &quot;type&quot;: &quot;Feature&quot;, &quot;properties&quot;: {}, &quot;geometry&quot;: { &quot;coordinates&quot;: [ [ [ 9.019743777219759, 48.939075160317145 ], [ 9.060437807540097, 48.70393235548886 ], [ 9.734017619469824, 48.7841975772329 ], [ 9.019743777219759, 48.939075160317145 ] ] ], &quot;type&quot;: &quot;Polygon&quot; } } ] } } ]"></textarea>
<textarea name="additionalLayers" id="additionalLayers" rows="10" placeholder="featureCollections array"></textarea>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Similar changes here and below.

}
]}
}]
</small>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now the examples are really lengthy? Do we really need all the info, which makes the sidebar rather long? After all it's only an example.

@ivigilm ivigilm merged commit 6a2f5d9 into main Nov 22, 2024
1 check passed
@ivigilm ivigilm deleted the slb/CADENZA-38130_showmapgeojson branch November 22, 2024 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants