Skip to content

Commit

Permalink
Merge pull request #1732 from girder/geojson-labels
Browse files Browse the repository at this point in the history
Better handle geojson label properties
  • Loading branch information
manthey authored Nov 25, 2024
2 parents 7859e0a + 0c357bc commit 226d15e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
- Better scale float-valued tiles ([#1725](../../pull/1725))
- Tile iterators now report their length ([#1730](../../pull/1730))
- When using griddata annotations as heatmaps, allow setting scaleWithZoom ([#1731](../../pull/1731))
- Handle any sort of label as an extra property when importing geojson annotations ([#1732](../../pull/1732))

### Changes

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ def _parseFeature(self, geoelem):
'fillColor', 'radius', 'width', 'height', 'rotation',
'normal',
}}
if 'label' in element:
if not isinstance(element['label'], dict):
element['label'] = {'value': element['label']}
element['label']['value'] = str(element['label']['value'])
if 'annotation' in geoelem.get('properties', {}):
self._annotation.update(geoelem['properties']['annotation'])
self._annotation['elements'] = self._elements
Expand Down

0 comments on commit 226d15e

Please sign in to comment.