Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Marker icon base64 string and real marker-icon.PNG conflict #1160

Open
sashberd opened this issue Dec 7, 2016 · 1 comment
Open

Marker icon base64 string and real marker-icon.PNG conflict #1160

sashberd opened this issue Dec 7, 2016 · 1 comment

Comments

@sashberd
Copy link

sashberd commented Dec 7, 2016

I have some strange issue with default marker image.
My markers are not rendered on map with default marker icon. The source of icon image tag looks like:
http://localhost:60000/js/grunt/dist/images/data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABkAAAApCAYAAADAk4LOAAAGmklEQVRYw7VXeUyTZxjvNnfELFuyIzOaberm..........
My queion was why base 64 string needs physical path, after small investigation I found that there is some ambiguous behavior in leaflet that combines path with base 64 string(see attached PS)
Am I doing something wrong or there is real problem with markers default images in current version?
untitled

@alcalin
Copy link

alcalin commented Feb 26, 2018

It can be seen here
that the source code tries to modify the image for the default icon in leaflet in a way different from the one recommended by leaflet docs here.

Nevertheless, a solution is to explicitly add the default icon's image as a custom icon when you define the markers for the directive. (Until it is fixed in the directive)

var base64icon = "data:image/png;base64,iVBO...ggg=="; var icondata = { iconUrl: base64icon, iconAnchor: [19, 19], };

       ` this.scope.markers = {
            myMarker: {
                lat: locationLat,
                lng: locationLon,
                draggable: false,
	    icon: icondata
            }
        };`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants