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 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
Thank you for you response. I'm talking about loading a file within a custom visual and not a web page. Apparently, I should use an object within capabilities but I don't know which one.
- v-viig9 years agoCommunity Champion
Anonymous,
I'm not sure that understand your case well.
Do you want to upload and save a file in Power BI? Is that correct?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
- Anonymous9 years agoNot applicable
I'm developing a custom visual that is displaying a shape map.
I want to know how I can upload the .geojson map into my custom visual.
In other words, how I can upload a file into my custom visual. I know that I can achieve that through defining an object in capabilities.json file. but I don't know how.
- v-viig9 years agoCommunity Champion
Anonymous
Just to make sure that my understaning is correct.
You want to have an ability to load a file by using the format panel. Is that correct?
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals