Class: IWGeoJSONUtils

IWGeoJSONUtils

A class with static utility functions to easily add GeoJSON files or strings to a map.

new IWGeoJSONUtils()

Methods


<static> showGeoJsonObject(text, renderer, style, clickListener, mouseOverListener)

Parses the GeoJSON data from the provided string and adds it to the specified map renderer.
Parameters:
Name Type Description
text string the GeoJSON data to show
renderer IWMapRenderer the map to show the data on
style object an instance of a class to create the rendering style; see tutorial for examples
clickListener function a handler function which is called on click events
mouseOverListener function a handler function which is called on mouseover events
Returns:
Type
void

<static> showGeoJsonString(text, renderer, style, clickListener, mouseOverListener)

Parses the GeoJSON data from the provided string and adds it to the specified map renderer.
Parameters:
Name Type Description
text string the GeoJSON data to show
renderer IWMapRenderer the map to show the data on
style object an instance of a class to create the rendering style; see tutorial for examples
clickListener function a handler function which is called on click events
mouseOverListener function a handler function which is called on mouseover events
Returns:
Type
void

<static> showGeoJsonUrl(url, renderer, style, clickListener, mouseOverListener)

Loads the GeoJSON file from the provided URL and adds it to the specified map renderer. Make sure that appropriate CORS headers are set for accessing the URL!
Parameters:
Name Type Description
url string the URL to load the data from
renderer IWMapRenderer the map renderer to show the data on
style object an instance of a class to create the rendering style; see tutorial for examples
clickListener function a handler function which is called on click events
mouseOverListener function a handler function which is called on mouseover events
Returns:
Type
void