If you have data in CSV or JSON format on your server, you can now ( v0.2.7 ) fetch that data remotely.
To specify CSV, set dataType
to "csv" and specify the dataUrl
for the resource.
The format for this data should be:
id,fillKey
NY,Visited
TX,Visited
CA,Visited
You can optionally pass more data for event handlers and popupTemplate:
id,fillKey,anotherProperty
NY,Visited,Value for another property
TX,Visited,will be passed as `data.anotherProperty` in popupTemplate
CA,Visited,more data
JSON is the default dataType
. For JSON data, just specify a dataUrl
.
The payload should look something like this:
{
"NY": {"fillKey": "Visited", "anotherProperty": "Born here"},
"TX": {"fillKey": "Visited", "anotherProperty": "Live here"},
"CA": {"fillKey": "Visited", "anotherProperty": "Here while writing this code"}
}