-
Notifications
You must be signed in to change notification settings - Fork 7
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
feat: custom markers (LAN-773) #233
Merged
Merged
+270
−2
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
c043cd6
to
a9ab9f5
Compare
@marination this PR is ready. Could you give it a final review? Known issues:
If you can think of a solution for these, I'd love to hear it. Otherwise, we can revisit this later. |
var Marker= L.icon({iconUrl: "/files/5a362498d26358.3248465915134977528618.png",
iconAnchor: new L.Point(12, 12),
iconSize: [24, 24],
});
L.DrawToolbar.include({
getModeHandlers: function(map) {
return [
{
enabled: this.options.polyline,
handler: new L.Draw.Polyline(map, this.options.polyline),
title: L.drawLocal.draw.toolbar.buttons.polyline
},
{
enabled: this.options.polygon,
handler: new L.Draw.Polygon(map, this.options.polygon),
title: L.drawLocal.draw.toolbar.buttons.polygon
},
{
enabled: this.options.rectangle,
handler: new L.Draw.Rectangle(map, this.options.rectangle),
title: L.drawLocal.draw.toolbar.buttons.rectangle
},
{
enabled: this.options.circle,
handler: new L.Draw.Circle(map, this.options.circle),
title: L.drawLocal.draw.toolbar.buttons.circle
},
{
enabled: this.options.circlemarker,
handler: new L.Draw.Circle(map, this.options.circlemarker),
title: L.drawLocal.draw.toolbar.buttons.circlemarker
},
{
enabled: true,
handler: new L.Draw.Marker(cur_frm.get_field("location").map, { icon: Marker }),
title: 'Place custom marker'
},
]
}
});
|
The rest LGTM |
🎉 This PR is included in version 0.13.0 🎉 The release is available on GitHub release Your semantic-release bot 📦🚀 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Depends on alyf-de/frappe#16
Bildschirmaufnahme.2023-10-27.um.12.35.34.mov
Todo:
Add image URL to GeoJSONprovide icon URLs via APIThis way we can change the icon without updating all the GeoJSON data.