@@ -42,7 +42,7 @@ export default class extends AbstractMapController<
42
42
iconSize : [ 25 , 41 ] ,
43
43
iconAnchor : [ 12.5 , 41 ] ,
44
44
popupAnchor : [ 0 , - 41 ] ,
45
- className : '' ,
45
+ className : '' , // Adding an empty class to the icon to avoid the default Leaflet styles
46
46
} ) ;
47
47
48
48
super . connect ( ) ;
@@ -189,11 +189,23 @@ export default class extends AbstractMapController<
189
189
190
190
let icon : L . DivIcon | L . Icon ;
191
191
if ( type === IconTypes . Svg ) {
192
- icon = L . divIcon ( { html : definition . html , iconSize : [ width , height ] , className : '' } ) ;
192
+ icon = L . divIcon ( {
193
+ html : definition . html ,
194
+ iconSize : [ width , height ] ,
195
+ className : '' , // Adding an empty class to the icon to avoid the default Leaflet styles
196
+ } ) ;
193
197
} else if ( type === IconTypes . UxIcon ) {
194
- icon = L . divIcon ( { html : definition . _generated_html , iconSize : [ width , height ] , className : '' } ) ;
198
+ icon = L . divIcon ( {
199
+ html : definition . _generated_html ,
200
+ iconSize : [ width , height ] ,
201
+ className : '' , // Adding an empty class to the icon to avoid the default Leaflet styles
202
+ } ) ;
195
203
} else if ( type === IconTypes . Url ) {
196
- icon = L . icon ( { iconUrl : definition . url , iconSize : [ width , height ] , className : '' } ) ;
204
+ icon = L . icon ( {
205
+ iconUrl : definition . url ,
206
+ iconSize : [ width , height ] ,
207
+ className : '' , // Adding an empty class to the icon to avoid the default Leaflet styles
208
+ } ) ;
197
209
} else {
198
210
throw new Error ( `Unsupported icon type: ${ type } .` ) ;
199
211
}
0 commit comments