max-mapper / max-mapper/modestmarker
Use coordinatePoint() instead of locationPoint()
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 6
- Forks
- 1
- PR merge metrics
- No merged PRs in 30d
Description
You probably won't notice the difference if there's only one marker on the map, but if you're planning on ever putting lots on at the same time you should convert the latitude and longitude to an MM.Coordinate in the constructor and update the position using map.coordinatePoint():
// in the constructor:
me.location = new MM.Location(latitude, longitude);
me.coord = me.map.locationCoordinate(me.location);
// in updatePosition:
var point = me.map.coordinatePoint(me.coord);
This will be much quicker because conversions between map and screen coordinates is linear.
Also, I would suggest putting the popup's DOM node into the marker so you don't have to update its position separately. :)
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the marker constructor and updatePosition method in the JavaScript implementation, focusing on the current locationPoint() usage. Verify that the location becomes an MM.Coordinate once and that updates use map.coordinatePoint(); done means marker positioning follows this path, with the popup DOM-node suggestion assessed separately.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- frontend, performance
- Issue type
- Refactor
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100