WIP refactor getPokestopMarker to show both rocket + reward #548
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.
getPokestopMarker has a lot of code duplication, in my opinion. This makes it hard to customize the appearance of pokestops. And, the existing implementation can't show both a rocket head + reward, and in this case it will only show the rocket head - which seems backwards, I'd prefer to see the quest reward!
This PR simplifies the whole thing to take a "merged" approach, where the html field of the marker icon is built up in stages. Rocket heads always go in the lower left, rewards on top of the marker.
TODO: This PR doesn't respect the "noRocket", etc. variables. I'm not sure it needs to, since aren't those things enforced in raw_data.php any way? Either way I didn't do it because I, personally, don't restrict them on my map.
TODO: I don't set the "class" correctly. If it has a rocket I set the rocket class, otherwise I just set the default marker class. I'm not convinced we're getting anything out of the custom CSS classes for the different marker categories, given that the thing you'd really want to customize is the size and placement of the rewards (which is hardcoded in getPokestopMarker...)
Some examples with this PR: