Custom data
The term custom data implies data in any format that is not supported by the standard Data Inspector Library rendering plugin. GeoJsonDataSource allows you to visualize custom data by creating your custom rendering plugin that takes data in any format and converts it to GeoJSON.
If you want to see an example of custom data converted to GeoJSON, you can use the following sample catalog:
hrn: "hrn:here:data::olp-here:rib-2",
layer name: "topology-geometry",
level: 12To visualize custom data from the sample catalog, follow these steps:
-
Install the web app generator and enter your application name when prompted.
-
Select the option
Custom data using custom JavaScript translators to GeoJSONwhen promptedWhat kind of data will you visualize on top of the Base map?. -
When prompted
HRN of the Catalog you want to visualize?, enter the HERE Resource Name (HRN) of the catalog that has the GeoJSON rendering. -
When prompted
Name of the layer you want to visualize?, enter the name of the layer that has the GeoJSON rendering. -
When prompted
On which level the data is stored?, enter the minimum zoom level that is required for the data to render. -
Once the code is generated, you can build and serve the web app by running the following command:
npm run startTo see the web app, open
http://localhost:8080in a web browser.To render the base map, enter the credentials that you obtained from the platform.
-
Locate the
renderer.plugin.template.jsfile in the root directory of your web app.
This file is a template for creating your custom plugin.
The template exports the required function getGeoJSON which converts the raw JSON data from a decoded partition into a GeoJSON object.
- Make a copy of this plugin template and adapt it according to your requirements.
For more information on creating custom rendering plugins, see Create Rendering Plugins.
Updated 2 days ago