Add Properties
You can add properties to your GeoJSON file to describe your points.
-
Add the appropriate properties to your GeoJSON file:
- title
- Lets you specify a title.
- description
- Lets you describe the point.
- color
- Lets you define the html color to be applied to the marker.
- image
- Lets you define the marker symbol to be used.
- onclick
- Adds a custom action launched when clicking a marker.
- onmouseover
- Adds a custom action launched when the mouse pointer is moved onto a marker.
- html
- Displays a custom html content (in a popup) when clicking a marker.
Below is an example:
{ "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" }, "geometry": { "type": "Point", "coordinates": [ -3.688136, 40.312541 ] } } , { "type": "Feature", "properties": { "color": "#ff0000", "title": "London", "description": "United Kingdom" }, "geometry": { "type": "Point", "coordinates": [ -0.324109, 51.554886 ] } } , { "type": "Feature", "properties": { "color": "#ff0000", "title": "Lisboa", "description": "Portugal" }, "geometry": { "type": "Point", "coordinates": [ -9.281809, 38.768028 ] } } ] }
- Save the GeoJSON file.