Skip to content

MarkerCluster, Geojson, CustomStyled markers 'Uncaught Type Error' #13

Closed
burakk opened this Issue Jan 4, 2014 · 10 comments

4 participants

@burakk
burakk commented Jan 4, 2014

I am using markercluster plugin and geojson features with customized icons:

var geojsonMarkerOptions = {
radius: 8,
fillColor: "#ff7800",
color: "#000",
weight: 1,
opacity: 1,
fillOpacity: 0.8
};

When i try to create canvas.toDataURL() i get uncaught type error on leaflet-image.js:127 ---> ctx.drawImage(root, pos.x, pos.y);

If i do not draw markers everything is fine.

@tmcw
Mapbox member
tmcw commented Jan 4, 2014

Are you using Leaflet via a CDN or a local copy?

@burakk
burakk commented Jan 6, 2014

I am testing locally with a local copy...

@tmcw
Mapbox member
tmcw commented Jan 6, 2014

And you have specified L_PREFER_CANVAS = true; on your page?

@burakk
burakk commented Jan 7, 2014

Yes i have L_PREFER_CANVAS = true;

@tmcw
Mapbox member
tmcw commented Jan 7, 2014

Works in my testing. Please provide an accessible test case.

@esisa
esisa commented Feb 28, 2014

I am not sure if this is related or if I am doing something very wrong here. But I have created a test case where if I run createImg(), I get a similar error. If I remove the Geojson layer it works fine.

https://gist.github.com/esisa/9271338

@tmcw
Mapbox member
tmcw commented Feb 28, 2014

@esisa you'll need to set L_PREFER_CANVAS = true; before you include any Leaflet source code.

@esisa
esisa commented Feb 28, 2014

Aha, I thought it was just before creating the map object.

Thanks, and sorry about polluting this thread.

@tmcw
Mapbox member
tmcw commented Jun 26, 2014

Closing, an accessible test case would be needed to debug this.

@tmcw tmcw closed this Jun 26, 2014
@rjawahar

Leaflet marker clusters are not getting saved, but saving plain markers have no such issue. Created a demo repo in github for this:

https://github.com/rjawahar/leaflet-image-demo

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.