Closed JaWeilBaum closed 2 years ago
Created the functionallity to use L.icon. This allows the user to add custom icons to a marker. The icon can either be provided by a an URL or by an file-path. This closes #3
You can use all options which are provided by leaflet (see documentation)
# Local file path icon_url = os.path.join(os.getcwd(), "pyqtle/web/modules/leaflet_171/images/marker-icon.png") # Remote url icon_url = "https://leafletjs.com/examples/custom-icons/leaf-red.png"
self.red_icon = L.icon(iconUrl=icon_url, options={ "iconSize": [38, 95], "iconAnchor": [22, 94], })
2. Add the icon to the marker ```lang=python self.marker.setIcon(self.red_icon)
What was done
Created the functionallity to use L.icon. This allows the user to add custom icons to a marker. The icon can either be provided by a an URL or by an file-path. This closes #3
You can use all options which are provided by leaflet (see documentation)
Example usage
self.red_icon = L.icon(iconUrl=icon_url, options={ "iconSize": [38, 95], "iconAnchor": [22, 94], })