Using a custom map with Vector Map


#1

Hi, I’m traying to use the Vector Map with German states defined in a GeoJson but in the documentation is no a clear way of how to import the GeoJson and in the example I can’t see what is in australia.js that is in the script that I imagine that is load the global object australiaShape, my GeoJson have this structure:

{
“type”: “FeatureCollection”,
“features”: [
{ “type”: “Feature”, “properties”: { “ID_0”: 86, “ISO”: “DEU”, “NAME_0”: “Germany”, “ID_1”: 1, “NAME_1”: “Baden-Württemberg”, “NL_NAME_1”: null, “VARNAME_1”: null, “TYPE_1”: “Land”, “ENGTYPE_1”: “State” }, “geometry”: { “type”: “MultiPolygon”, “coordinates”: [ [ [ [ 8.708400940398242, 47.715581894910606 ], [ 8.713716147005524, 47.701734382960055 ], [ 8.722388326206879, 47.696559050210858 ], [ 8.711338291418055, 47.694321068481479 ], [


#2

hi @ryan, thanks for use ChartFactor and point out the Vecor Map documentation and live demos missing items, we will expand the documentation and make visible that files in the live demos in the future, for now you can download the full demo from here and as in the demo you can simply take the geojson and use it as a global vairable then use that global vairable to set it yo your map in .set(shape, GLOBAL_VAIRABLE) or read the geojson form a public url, parse it and use the parsed object to set it to the visual, and change the property NAME_1 to name, for example:

window.deutschlandShape = {
“type”: “FeatureCollection”,
“features”: [
{ “type”: “Feature”, “properties”: { “ID_0”: 86, “ISO”: “DEU”, “NAME_0”: “Germany”, “ID_1”: 1, “name”: “Baden-Württemberg”, “NL_NAME_1”: null, “VARNAME_1”: null, “TYPE_1”: “Land”, “ENGTYPE_1”: “State” }, “geometry”: { “type”: “MultiPolygon”, “coordinates”: [ [ [ [ 8.708400940398242, 47.715581894910606 ], [ 8.713716147005524, 47.701734382960055 ], [ 8.722388326206879, 47.696559050210858 ], [ 8.711338291418055, 47.694321068481479 ], [ …

let us know if you have any otther issue.