You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Repository navigation
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
Incorrect URL generated in MapboxStaticImage when using StaticMarkerAnnotation without label #9107
Use MapboxStaticImage.Builder() to build a MapboxStaticImage that uses the StaticMarkerAnnotation to build a marker that has a name, lat, long, color and nothing else. Notice the lack of a label to accompany the name.
The builder should otherwise be valid, with key, size, style, etc.
.build() the MapboxStaticImage.Builder and run code. Observe the URL produced.
Expected behavior
The URL is valid.
Actual behavior
The URL is invalid. The problem lies with the part of the URL representing the marker. The following is an example of the invalid URL.
The invalid section is this: pin-s-+4990e2(-122.46589,37.77343). There is a hanging - before the hexcolor +4990e2where the (absent) label goes. It can be corrected by scrapping the hanging - so that the resulting section is pin-s+4990e2(-122.46589,37.77343).
private String correctMissingLabel(String staticImageUrl) {
// Potential bug if "-+" is a substring of our Mapbox key. It isn't, so it's fine. I don't even think those are valid characters.
return staticImageUrl.replace("-+", "+");
}
Activity
TheIronMarx commentedon May 25, 2017
In the mean time, here's my workaround.
Guardiola31337 commentedon Jun 12, 2017
@TheIronMarx thanks for reaching out and reporting your problem.
This should be fixed when mapbox-java#479 lands.
Closing here. Thanks again and let us know if you find any other issues 👍