If you have a large number of map layers and you'd like to import them in bulk rather than creating them manually, this can be done by pre-populating a GeoJSON file using a template. Follow the steps below to find out more.
There are two possible approaches:
The fields defining the map features sit inside a metadata object - the structure of your GeoJSON file should look something like this:
{
"type": "FeatureCollection",
"features": [
{
"type": "Feature",
"metadata": {
"name": "Layer name 1"
"fillColor": "#000000",
"strokeColor": "#000000",
"highlightFillColor": "#000000",
"highlightStrokeColor": "#000000",
"svg": "",
"hoverablePopup": true,
"title": "Hover panel title",
"description": "Hover panel description",
"imageUrl": "",
"imageAlt": "",
"externalLink": "https://example.com",
"proposalId": "",
},
"properties": {},
"geometry": {}
}
]
}The purpose of each field can be found in the table below:
Field | Purpose |
| Name of the layer inside Commonplace map edit mode - not public - should be unique per layer |
| Colour of polygons/points (hex code format) |
| Colour of lines and outer boundaries of polygons (hex code format) |
| Colour of polygons/points when hovered (hex code format) |
| Colour of lines and outer boundaries of polygons when hovered (hex code format) |
| Defines a custom SVG (points only) |
| Show/hide the hover panel |
| Hover panel title - recommended maximum of 30 characters |
| Hover panel description - recommended maximum of 150 characters |
| URL of the hover panel image (if not uploaded online please contact customers@commonplace.is) |
| Accessible alt text for the hover panel image |
| If you'd like the hover panel to link to a URL |
| If you'd like the hover panel to link to a Commonplace tile (overrides the hover panel image/title/description with that of the Commonplace tile - ask Commonplace for the tile ID) |
| Not used by Commonplace |
Click the following link to open the template spreadsheet
Download the sheet or make a copy - then open it in spreadsheet editing software such as Microsoft Excel or Google Sheets
Open the 'Points | Template' tab
Populate the columns in the sheet with the various different attributes you want the layers you upload to have
At the top of the sheet, each column has the following information to help you:
Required/optional
Lets you know whether this column must be populated or can be left blank
Description
Contains useful information for this column - such as which formats are accepted or recommended image dimensions
Example
Demonstrates an example of the data that particular column should be populated with
Each layer must have the following:
A layer name
A latitude
A longitude
A fill colour
A true or false value for whether or not a hover panel should be enabled
If a hover panel is enabled, a title is required - a description and image can optionally be added. If an image is added, image alt text is required for accessibility purposes
Hover panels can also include a link - either to an external URL, or to another Commonplace tile
If linking to another Commonplace tile, the title, image and description will be pulled in from the tile - however, for data validation reasons a title should still be populated in the upload sheet even though it will not be visible after uploading
Once the template tab has been populated, move on to the 'Points | Generator' tab
Drag the formula in column D down to match the number of layers in the 'Points | Template' tab
Download the template.geojson file
Open the file using Notepad on Windows or TextEdit on MacOS
Copy all the 'features' from column D in your spreadsheet, and paste them between the square brackets after features:
features: []Remove the comma after the last 'feature'
Rename the file and then save it - ensure that it saves with a .geojson extension and not a .txt extension
Go to your Commonplace map
Follow the instructions under the Shapefile section to upload your layers
If you encounter an error, one of the following may be the cause:
Incorrect formatting - try uploading to a site like https://jsonformatter.org/ to verify that the file is formatted correctly
Uploading too many features at once - try splitting the upload into smaller batches
Once you have uploaded your layers, refresh the page and they will be visible
Don't forget to populate your legend with the colour coding used for your layers if required
If you make a mistake when uploading your layers and would like to delete them and start again, please contact the support team.
Introduction to maps / how to create and edit a map tile
Still unsure about anything? There's lots more information here on the Commonplace Help Centre - alternatively, contact the support team and we'll be happy to help 