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

Fixes Missing Map Icons #482

Merged
merged 2 commits into from Apr 18, 2024
Merged

Fixes Missing Map Icons #482

merged 2 commits into from Apr 18, 2024

Conversation

holmbergius
Copy link
Contributor

Wildbook color-coded its Google Maps pins using a Google Charts API that was turned off in 2019 yet still kept working until...now-ish. With that API now completely turned off for good, our maps pins are missing.

This is the old call:
icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=colorToUseForMarker%>',

The short-term fix is to replace the icon attribute with a Materials font family character label. This actually adds a bit of diversity in the symbols we can use and ended up being somewhat of an improvement in that we can tweak more of the infill, color, size, and display of the icon.

Longer-term, we need to migrate Marker to AdvancedMarkerElement, but that is a major overhaul.

Tested successfully in Chrome and Firefox.

PR fixes #435
image

image

@holmbergius holmbergius marked this pull request as draft April 18, 2024 05:48
@holmbergius holmbergius self-assigned this Apr 18, 2024
@holmbergius
Copy link
Contributor Author

@naknomum Would love your thoughts on the fix.

@@ -1293,9 +1294,17 @@ if(CommonConfiguration.showProperty("showCountry",context)){
%>

marker = new google.maps.Marker({
icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
//icon: 'https://chart.googleapis.com/chart?chst=d_map_pin_letter&chld=<%=markerText%>|<%=haploColor%>',
icon: " ",
Copy link
Member

Choose a reason for hiding this comment

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

am guessing the space must be needed here (versus just dropping the icon element from the json entirely).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I believe the space is needed according to some reading I did on this issue. But I also didn't test without it.

Copy link
Member

@naknomum naknomum left a comment

Choose a reason for hiding this comment

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

seems like a solid workaround until we update to advanced marker api.

@holmbergius holmbergius marked this pull request as ready for review April 18, 2024 17:19
@holmbergius
Copy link
Contributor Author

Thanks to @goddesswarship for a quick QA on a test deployment. Fix looks good there too.

@holmbergius holmbergius merged commit 4db443d into master Apr 18, 2024
2 checks passed
@holmbergius holmbergius deleted the update-google-maps branch April 18, 2024 17:56
holmbergius added a commit that referenced this pull request Apr 23, 2024
Fixes Missing Map Icons
# Conflicts:
#	src/main/webapp/encounters/encounter.jsp
holmbergius added a commit that referenced this pull request Apr 23, 2024
Fixes Missing Map Icons
# Conflicts:
#	src/main/webapp/encounters/encounter.jsp
holmbergius added a commit that referenced this pull request Apr 24, 2024
Fixes Missing Map Icons
# Conflicts:
#	src/main/webapp/encounters/encounter.jsp
@TanyaStere42 TanyaStere42 added this to the 10.1.0 milestone Apr 26, 2024
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.

Location Pins Missing in Google Maps API in Encounter page
3 participants