Editing a GeoJSON File

You can modify the properties and actions described in your GeoJSON files.

This task shows you how to:

Add Properties

You can add properties to your GeoJSON file to describe markers.

  1. Add the appropriate properties to your GeoJSON file:
    PropertyDescription
    title The title of the marker.
    description The description of the marker.
    color The HTML color of the marker.
    image The symbol used for the marker.
    onclick The custom action launched when clicking a marker.
    onmouseover The custom action launched when the mouse pointer is on the marker.
    html Displays a custom html content (in a popup) when clicking a marker.
    tags The custom Tags created for the marker. This property must include the following subproperties:

    Subproperty Description
    tagName The W category and tag name for your tag. Include the prefix ds6w before the W category and tag name.
    tagValue The tag value used to filter your markers.

    You can find an example after the table.

    Below is an example using all the properties.

    {
    "type": "FeatureCollection",
    "features": [
    { "type": "Feature", "properties": { "color": "#0000ff", "title": "Paris", "description": "France" }, "geometry": { "type": "Point", "coordinates": [ 2.492286, 48.844174 ] } }
    ,
    { "type": "Feature", "properties": { "color": "#ff0000", "title": "Madrid", "description": "description", "tags":[ { "tagName":"ds6w:where/Location", "tagValue":["Oceania","Australia","Chelsea"] } ] }, "geometry": { "type": "Point", "coordinates": [ -3.688136, 40.312541 ] } }
    ,
    { "type": "Feature", "properties": { "color": "#ff0000", "title": "London", "description": "United Kingdom", "tags":[ { "tagName":"ds6w:what/Industry", "tagValue":"High Tech" } ] }, "geometry": { "type": "Point", "coordinates": [ -0.324109, 51.554886 ] } }
    ,
    { "type": "Feature", "properties": { "color": "#ff0000", "title": "Lisboa", "description": "Portugal", "tags":[ { "tagName":"ds6w:who/NumberofUsers", "tagValue":"<100" } ], "geometry": { "type": "Point", "coordinates": [ -9.281809, 38.768028 ] } }
    
    ]
    }

    Here is another example for the tags properties:

    "tags":
      [
        {
          "tagName":"ds6w:where/location",
          "tagValue":"Australia"
        }
      ]

    Note: If you need to create a hierarchy, use an array for the tagValue. For example, the sample below:
    "tags":
      [ 
        {
          "tagName":"ds6w:where/Geolocation",
          "tagValue":["NORTH AMERICA","United States","Houston"]
        }
      ]
    Creates the following structure in Tags:

  2. Save the GeoJSON file.

Call Custom Actions

You can customize the available actions to adapt them to your needs.

  1. Describe the action to be customized and use a semicolon to separate parameters.

    For instance:

    GlobeViewer.Marker.add;lat,lon,alt,color,title,description

    The available actions are:

    GlobeViewer.Marker.add
    Adds a marker using the following format:
    lat,lon,alt,color,title,description
    GlobeViewer.Marker.clear
    Removes all markers.
    GlobeViewer.Country.add
    Colors a country using the following format:
    iso3-code,color,description
    GlobeViewer.Country.clear
    Removes all countries.
    GlobeViewer.Camera.move
    Modifies the camera viewpoint using the following format:
    lat,lon,level
    GlobeViewer.loadJSON
    Loads JSON data.

  2. Save the GeoJSON file.