javascript - Displaying bubbles in Kartograph.js -
i trying create bubbles on svg map generated kartograph. want this: http://kartograph.org/showcase/symbols/
the map loads symbol not display. have no errors thrown in javascript console.
$(document).ready(function() { var map = $k.map('#map'); map.loadmap("mapfinal.svg", function() { // add layers map.addlayer('background', { styles: { fill: '#e8f9fb', 'stroke': 'none' } }); map.addlayer('world', { styles: { fill: '#f5f3f2', 'stroke': 'none' } }); map.addlayer('states', { styles: { fill: '#fff', 'stroke': '#882222', 'stroke-width': 0.5, 'stroke-opacity': 0.4 } }); map.addlayer('urban', { styles: { fill: '#553344', 'fill-opacity': 0.6, 'stroke': 'none' } }); map.addsymbols({ type: kartograph.bubble, data: [{ lon: -104, lat: 40.5, name: 'berlin' }], radius: 40, location: function(d) { return [d.lon, d.lat] }, style: 'fill:#800000; stroke: #fff; fill-opacity: 0.5', }); });
});
i don't know else do. have followed example code , read docs.
in case else runs in future, issue map itself. whatever reason, there bug in kartograph.py framework generates sqg maps incorrect coordinates. bubbles not showing because longitude , latitude not present on map. when regenerated map using laea projection, worked.
Comments
Post a Comment