max-mapper / max-mapper/modestmarker

Use coordinatePoint() instead of locationPoint()

Open
#1 1 comment 0 reactions 0 assignees View on GitHub

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

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.