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

Machina marker icon #659

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed plugins/images/marker-machina.png
Binary file not shown.
1 change: 1 addition & 0 deletions plugins/images/marker-machina.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions plugins/machina-tracker.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,17 @@ machinaTracker.events = [];
machinaTracker.setup = () => {
$('<style>').prop('type', 'text/css').html('@include_string:machina-tracker.css@').appendTo('head');

var iconImage = '@include_img:images/marker-machina.png@';

machinaTracker.icon = L.icon({
iconUrl: iconImage,
iconSize: [26, 32],
iconAnchor: [12, 32],
});
var iconImage = '@include_img:images/marker-machina.svg@';

machinaTracker.icon = new (L.Icon.Default.extend({
options: {
iconUrl: iconImage,
MysticJay marked this conversation as resolved.
Show resolved Hide resolved
iconRetinaUrl: iconImage,
iconSize: [26, 32],
iconAnchor: [12, 32],
Copy link
Contributor

Choose a reason for hiding this comment

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

Any comment on why you want to specify different sizes than defaults here?

It makes the icon smaller than the Enl/Res tracker.
And the values are now same as default, then remove them and keep the default in use - there's no need to specify it again and will result in more work later when we'll want to change the size of all these tracker markers.

shadowAnchor: [12, 41],
MysticJay marked this conversation as resolved.
Show resolved Hide resolved
},
}))();

machinaTracker.popup = new L.Popup({ offset: L.point([1, -34]) });
machinaTracker.drawnTraces = new L.LayerGroup([], { minZoom: machinaTracker.MACHINA_TRACKER_MIN_ZOOM });
Expand Down
Loading