Skip to content

Could not display the default blue Icon of MarkerΒ #5553

Closed
@GetHugWuSheng

Description

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions