ui-leaflet
ui-leaflet copied to clipboard
LeafletPathsHelper should retain unrecognised path's options
LeafletPathsHelper.createPath
would remove any options that it does not recognise.
Currently recognised options:
var availableOptions = [ // Path options 'stroke', 'weight', 'color', 'opacity', 'fill', 'fillColor', 'fillOpacity', 'dashArray', 'lineCap', 'lineJoin', 'clickable', 'pointerEvents', 'className', // Polyline options 'smoothFactor', 'noClip' ];
Can other options be retained so that extensions will still be able to access them? It will be desirable to be able to customise each path with a different context menu.
eg: m1: { lat: 51.50, lng: -0.082, contextMenuCustom: [{ text: 'London item', }], },
m2: { lat: 48.83, lng: 2.37, contextMenuCustom: [{ text: 'Some other item', }, { text: 'Second item', }, ], }
For full example: please see http://jsfiddle.net/s8ka3epp/, which consist of two markers and one path. Note that in the example, the context menu for path is not working precisely because it was filtered out.
Well if availableOptions
was made public then you would be able to override the factory to use whatever availableOptions
you want. However, a simple hack PR for now would just include those extra features onto availableOptions
.
Also by overriding I mean you would be able to use a decorator at angular.config time.
Let me know how you think this should be.
What is the point of availableOptions at first place?