fix: Correctly parse <hotSpot>
elements
#1173
Merged
+65
−14
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.
Fixes #1172
The library currently never parses
<hotSpot>
element in KML, because they are always empty tags. A valid<hotSpot>
element should be empty, with the necessary attributes like the following:I also adjusted the test for parsing
<hotSpot>
to be a valid KML file (none ofx
,y
,xunits
, oryunits
are valid attributes for<Style>
), and with a valid and invalid<hotSpot
> in the case of an invalid<hotSpot>
the default anchor should be used.Finally, I also added some warnings to clarify that the library only supports
xunits
andyunits
that have the value"fraction"
. I would recommend that this clarification is made in the KML support table in the official developer docs. The warnings are the best way to let a user know about this, since there are other values that are part of the KML spec, and it's confusing why the<hotSpot>
for a style isn't working when the units are"pixels"
or"insetPixels"
.In order to test with another application, I had to update the root and library
build.gradle
files to support Jitpack. Let me know if I should take these changes out of the PR, but the current Jitpack override in the librarybuild.gradle
does not work.