Forum Discussion
Anonymous
9 years agoNot applicable
Load GeoJson Map to capabilities.json
Hello, I'm currently developing a custom visual, so I'm looking to load a geojson map through capabilities.json. My question is: how can I achieve that ? Shall I just consider the map as measure ...
- 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
v-viig
9 years agoCommunity Champion
It isn't possible for custom visuals unfortunately.
There're a few options:
- Load it from an external resource that uses HTTPS
- Keep maps in Power BI data-set and then apply data to the visual. The data would be avialable in the update method
- You can use JS File API to load from local device/PC
- Keep it in an external JS and include into pbiviz.json
Ignat Vilesov,
Software Engineer
Microsoft Power BI Custom Visuals
Anonymous
8 years agoNot applicable
v-viig I'm wondering how I can store a geojson file as Power Bi dataset and call it in Data view. Do you have any example doing same thing ? What I did I stored the geojson data set as a string in a table. and then I make an outer join with the dataset containing data. so that each time I get the geojson and dataset.