Forum Discussion
Load GeoJson Map to capabilities.json
- 8 years ago
Regarding the first question you should follow these steps:
- Take a look at this topic to find out more about JS File API
- Define a text property at capabilities.json
"objects": { "internalState": { "displayName": "Internal State", "properties": { "geojsonMap": { "displayName": "geojsonMap", "type": { "text": true } } } } }- Call persistProperties method of host
function save(host: IVisualHost, value: string) { host.persistProperties(<VisualObjectInstancesToPersist>{ merge: [{ objectName: "internalState", selector: null, properties: { geojsonMap: value || "" } }] }); }Regarding the second question.
You should prepare type definitions for you function. Another way is to use TS file instead of JS.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Anonymous,
You may do research into objects in API https://github.com/Microsoft/PowerBI-visuals-tools/blob/master/templates/visuals/.api/v1.6.0/schema.capabilities.json. Also check if a Shape Map visual could be an alternative.
Shape file could be an alternative but is its source code available for developement ? In Fact I'm looking to load a geojson map and display it using d3 Library .. But I don't know how to load the json file.
- v-viig9 years agoCommunity Champion
Hello Anonymous
Do you want to load json file from local computer or do you want to save it using Power BI Data sets?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- Anonymous9 years agoNot applicable
Either way, for now, I just want to display a custom map. So it can either be load from a local file, or through a drap and drop via Power BI.
Thank you for your help :)
- v-viig9 years agoCommunity Champion
Anonymous,
You might load local file using FileReader.
Please feel free to ask us any questions about custom visual development.
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals