fix: render blue dot fallback for point features without SIDC#113
Open
axel-krapotke wants to merge 1 commit intomainfrom
Open
fix: render blue dot fallback for point features without SIDC#113axel-krapotke wants to merge 1 commit intomainfrom
axel-krapotke wants to merge 1 commit intomainfrom
Conversation
Point features arriving via LiveDataSource (SSEVectorSource) that carry neither an SIDC nor a custom SVG produced a Style with symbol-code set to undefined. In styleFactory.makeImage none of the branches matched, so the feature was rendered without an image and stayed invisible. Return a blue dot style spec in that case so the feature is locatable on the map.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Point features arriving via the ODIN
LiveDataSource(implemented asSSEVectorSource) were not visible on the map when the incoming GeoJSON carried neither ansidcproperty nor a customsvgproperty — even though data was clearly flowing.Root cause
In
src/renderer/ol/style/symbol.js, the style spec for point features was built unconditionally as:When
sidcis missing,symbol-codebecomesundefined. The style spec then flows intostyleFactory.makeImage(src/renderer/ol/style/styleFactory.js:188-195):None of the branches match,
makeImagereturnsnull, and the resultingol.style.Stylehas noimage. The feature is attached to the source but renders as nothing on the map.Missing SIDCs are a legitimate case for live data feeds, so filtering the feature out is not acceptable — we want at least a locatable marker.
Fix
In
symbol.js, when neithersvgnorsidcis present, return a fallback blue dot style spec that uses the existingcircle-*props already supported bymakeCircle:This mirrors OpenLayers' canonical default point style and keeps such features visible without needing new registry entries (unknown IDs pass inline props through — see
styleRegistry.js:192).Line/Polygon features without SIDC are unaffected —
shape.jsalready falls back to a black default stroke.Test plan
sidcproperty → military symbol renders as beforesvgproperty → custom SVG renders as beforesidcand withoutsvg→ blue dot appears at the feature locationsidc→ still render with default black stroke