Skip to main content

Sample GeoJSON files

Four quadrants over Houston, in three files. The geometry is identical in each and only the properties change, so you can upload them side by side and compare how each coloring mode behaves.

Every file uses region_id as the Region ID property, with values NW, NE, SW, SE. All three render as soon as you upload them. Nothing has to be saved to Salesforce first.

FileDemonstrates
explicit-colors.geojsonColors baked into the file, one per feature
categorical.geojsonA categorical scale over a text property
numeric-values.geojsonGraduated and continuous scales over the same numeric property

1. Colors in the file

Upload explicit-colors.geojson and pick region_id as the Region ID property. That's it: the four quadrants draw blue, yellow, purple and red straight away, because each feature carries a color.

{ "region_id": "NW", "name": "Northwest quadrant", "color": "#2E86AB" }

No layer configuration needed. Use this when you've already decided the colors and there's no underlying value to derive them from. The legend names each swatch after the region carrying it (NW, NE, SW, SE), since nothing in the file says what a color means.


2. Categorical

Upload categorical.geojson, pick region_id, then set Color by to zone. The quadrants carry a zone instead of a color:

{ "region_id": "NW", "name": "Northwest quadrant", "zone": "North" }

The map colors itself immediately: one color per distinct zone, no records involved. Saving the layer stores that generated scale on Region Color Map, so it survives a reload and you can refine it there:

{
"type": "categorical",
"property": "zone",
"stops": [
{ "value": "North", "color": "#2E86AB", "label": "Northern zone" },
{ "value": "South", "color": "#C0392B", "label": "Southern zone" }
],
"other": "#DDDDDD"
}

Written by hand like this, the two northern quadrants turn blue, the southwest red, and the southeast picks up the grey other color, because its zone is Unassigned and matches no stop. Drop other and it would draw transparent instead. (The scale Mosaic generates for you gives Unassigned its own color rather than treating it as leftover, since it can't know which values you consider real.)


3. Graduated

Upload numeric-values.geojson, pick region_id, then Color by density. Because the values are numeric, Mosaic bins them instead of treating each as its own category, and again it renders before anything is saved. Each quadrant carries a density:

Regiondensity
NW850
NE4,200
SW12,500
SE26,000

The generated bins follow the data: Up to 850, 850 - 4,200, 4,200 - 12,500, 12,500+. To choose the breaks yourself, set Region Color Map on the layer record to something like:

{
"type": "graduated",
"property": "density",
"stops": [
{ "upperBound": 1000, "color": "#EDF8E9" },
{ "upperBound": 5000, "color": "#BAE4B3" },
{ "upperBound": 15000, "color": "#74C476" },
{ "upperBound": null, "color": "#238B45", "label": "15,000+" }
]
}

Each quadrant lands in a different bin, palest to darkest going clockwise from the northwest. The legend labels them Up to 1,000, 1,000 - 5,000, 5,000 - 15,000 and 15,000+: the first three derived from the bounds, the last one named explicitly by the stop.


4. Continuous

Same file, same layer. Just swap the scale:

{
"type": "continuous",
"property": "density",
"domain": [0, 30000],
"range": ["#F7FBFF", "#6BAED6", "#08306B"]
}

Now the colors are interpolated rather than binned, so the four quadrants sit at different points along one ramp. The legend becomes a gradient bar labeled 0 and 30,000. Values outside the domain clamp to its ends.


Things worth noticing

Nothing here requires saving first. Uploaded layers are colored in the browser, so you can try a file, change what you color by, and throw it away without creating a single record. Saving is what makes it permanent, and it stores the generated scale on the layer record so the map looks identical on reload.

Leave Color by empty and the layer still shows. A file with no color property and nothing to color by gets one default fill rather than drawing invisible, so an upload is never a blank screen.

The scale overrides colors in the file. Add a color property to categorical.geojson and it shows on upload, then gives way to the scale's colors once one exists. That's the precedence rule in action.

Set the labels. Give the layer a Region ID Label of Quadrant and a Region Value Label of Population Density. The hover tooltip becomes Quadrant: NW and the legend is titled Population Density by Quadrant.