Could not display the default blue Icon of MarkerΒ #5553
Closed
Description
opened on Jun 9, 2017
Environment
- Leaflet : 1.0.3+master.162276e
- Browser : Chrome Version 55.0.2883.87 (64-bit)
- OS/Platform : Ubuntu 16.04
Issue
Could not display the Leaflet's default blue Icon of Marker.
The source code in src/layer/marker/Icon.Default.js as below
var path = DomUtil.getStyle(el, 'background-image') || DomUtil.getStyle(el, 'backgroundImage');
document.body.removeChild(el);
if (path === null || path.indexOf('url') !== 0) {
path = '';
} else {
path.replace(/^url\([\"\']?/, '').replace(/marker-icon\.png[\"\']?\)$/, '');
}
For the replaced result string didn't store back to path variable, the Icon got a wrong URL.
The last line should be replaced by
path = path.replace(/^url\([\"\']?/, '').replace(/marker-icon\.png[\"\']?\)$/, '');
Activity