Hey
First i would like to say that you work is awesome !
So my problem
I have a map that allow me to display PieChartDataLayerand BarChartDataLayer
I use all your example to display them successfully in FF/Chrome
But in IE 8 I always get this error :
Error loading centroid for {"id":"05","type":"Feature","geometry":{"type":"Polygon","coordinates":[[[6.6358,44.4469],[6.4863,44.4491],[6.371,44.5245],[6.247,44.4417],[6.0864,44.4653],[5.9562,44.3958],[5.9295,44.2923],[5.8335,44.2594],[5.7615,44.2086],[5.6854,44.1902],[5.6858,44.2388],[5.6372,44.3285],[5.4999,44.3398],[5.4287,44.4147],[5.5111,44.4942],[5.6114,44.467],[5.6008,44.5456],[5.6965,44.6507],[5.8058,44.7059],[5.9553,44.7722],[6.0606,44.8155],[6.1398,44.865],[6.2758,44.8711],[6.3647,44.9102],[6.3245,45.0044],[6.2097,45.0148],[6.2634,45.1282],[6.3687,45.0704],[6.4835,45.0932],[6.6312,45.1119],[6.6751,45.0228],[6.7709,44.9649],[6.8425,44.862],[6.9869,44.8461],[7.0361,44.7242],[6.9547,44.6556],[6.8055,44.605],[6.7134,44.5393],[6.6358,44.4469]]]},"properties":{"name":"Hautes-Alpes","id":"05"}}
I have 20 polygon to display and this error is getting on my nerve !
I look at the code to see where it's coming from and I found in the leaflet-dvf.js where the problem is (Line 610~~)
loadCentroid: function(feature) {
var centroidLatLng = null;
var centroid;
var x, y;
if (feature.geometry && feature.geometry.type === "Point") {
centroidLatLng = new L.LatLng(feature.geometry.coordinates[1], feature.geometry.coordinates[0]);
} else if (typeof jsts !== "undefined") {
var parser = new jsts.io.GeoJSONParser();
var jstsFeature = parser.read(feature);
//The problem happens here or just before (it go directly in the try/catch)
if (jstsFeature.getCentroid) {
So I would like to know if there is a fix to load the centroid.
FYI : I load those library
script src="js/leaflet.js"></script> (Last version 1.7.2)
script src="js/jquery-1.6.4.min.js"></script>
//Library for centroid
script src="js/javascript.util.js"></script>
script src="js/jsts.js"></script>
//Library for VML
script src="js/core-1.0.5.js"></script>
script src="js/svg.js"></script>
script src="js/leaflet-dvf.js"></script>
//Other library
script src="js/leaflet.markercluster.js"></script>
script src="js/leaflet.markercluster-src.js"></script>
script src="js/jquery.xcolor.js"></script>
script src="js/jquery.xcolor.min.js"></script>