Skip to main content

Managing Locator Data in CMS

This guide explains how to add, edit, export, and import locator rows in the CMS at cms.mapviewer.eu or your custom CMS URL.

Overview​

The locator database stores location data for the store locator. Each row represents a retail location or point of interest with geographic coordinates and business information.

Database Schema​

ColumnTypeDescription
idint8 (auto)Primary key, auto-incremented
google_place_idtextGoogle Places unique identifier
google_resource_nametextGoogle resource identifier
google_plus_codetextGoogle Plus Code (e.g., 8FVC2222+22)
store_idtextYour internal store identifier
display_nametextDisplay name for the location
business_statustextCurrent business status (OPERATIONAL, CLOSED, etc.)
monday_hours - sunday_hourstextOpening hours for each day (format: 09:00-18:00)
phonetextContact phone number
websitetextStore website URL
addresstextFull street address
country_codetextISO country code (NL, BE, DE, etc.)
citytextCity name
zipcodetextPostal code
user_propertiestextCustom user-defined properties
tagsjsonJSON array of tags (e.g., ["category 1", "category 2"])
typesjsonJSON array of product categories (e.g., ["category 1", "category 2"])
last_updatedtextTimestamp of last update (ISO format)
latitudefloat8Geographic latitude (WGS84)
longitudefloat8Geographic longitude (WGS84)
geomgeometry(Point,4326)PostGIS point geometry (auto-generated from lat/lng)

Accessing CMS​

  1. Navigate to https://cms.mapviewer.eu
  2. Log in with your credentials
  3. Select the Mapviewer project (if applicable)
  4. Navigate to the locator collection

Adding New Locations​

Method 1: Through CMS UI​

  1. Navigate to the collection

    • Click on Collections in the sidebar
    • Select locator collection
  2. Create new entry

    • Click the + Create button (top-right)
  3. Fill in required fields

Core Information​

FieldRequiredFormatExample
display_nameYesTextStore name
latitudeYesDecimal51.3
longitudeYesDecimal4.2
FieldFormatExample
store_idTextid
addressTextKerkweg
cityTextMaasland
zipcodeText3155 VL
country_codeISO 3166-1NL
phoneE.164+31
websiteURLhttps://example.com
typesJSON Array["category 1", "category 2"]
business_statusTextOPERATIONAL

Hours Fields​

Enter hours in HH:MM-HH:MM format. Leave empty for closed days.

monday_hours: "09:00-18:00"
tuesday_hours: "09:00-18:00"
wednesday_hours: "09:00-18:00"
thursday_hours: "09:00-20:00"
friday_hours: "09:00-20:00"
saturday_hours: "10:00-17:00"
sunday_hours: "12:00-17:00"

Special Fields​

  • types: JSON array of product categories. Use lowercase names matching your store product types:

    ["category 1", "category 2", "category 3"]

    Tip: Multiple types can be selected. This determines which filter categories the location appears under in the locator app.

  • tags: JSON array for additional categorization:

    ["flagship", "display", "seasonal"]
  1. Save the entry
    • Click Save (top-right)
    • The id and geom fields are auto-generated
    • The last_updated field is auto-populated with the current timestamp

Method 2: Import from Google Places​

If you have Google Places data:

  1. Ensure you have the Google Place ID
  2. Create a new entry and paste the google_place_id
  3. CMS can auto-populate some fields from Google (if configured)
  4. Manually verify and complete missing fields

Editing Existing Locations​

Finding a Location​

  1. Navigate to locator collection
  2. Use the search box to find by display_name, store_id, or address
  3. Click on the entry to open the edit view

Updating Fields​

  1. Basic fields: Edit text directly in the form fields
  2. Coordinates: Update latitude and longitude decimal values
    • Use Google Maps or similar to find coordinates
    • Format: 52.3667 (not 52,3667 - use period, not comma)
  3. JSON fields (types, tags): Edit as JSON arrays
    • Example: ["category 1", "category 2"]
    • Validate JSON syntax before saving
  4. Hours: Update each day separately in HH:MM-HH:MM format

Bulk Editing​

For editing multiple locations at once:

  1. Navigate to the locator collection
  2. Use the checkboxes to select multiple entries
  3. Click Actions > Batch Update
  4. Select the field to update (e.g., business_status)
  5. Enter the new value
  6. Click Apply

Note: Batch update only allows updating one field at a time for all selected entries.


Exporting Data to CSV​

Method 1: CMS CSV Export​

  1. Navigate to locator collection
  2. Click the Export button (top-right, looks like a download icon)
  3. Select CSV as the format
  4. Choose which fields to include (recommended: select all)
  5. Click Export
  6. The CSV file will download automatically

Method 2: Filtered Export​

  1. Apply filters to the collection view (e.g., filter by country_code or types)
  2. Click Export > CSV
  3. Only the filtered results will be exported

CSV File Structure​

The exported CSV will have columns matching the database schema. Important notes:

  • JSON fields (types, tags, user_properties) will be exported as JSON strings
  • Geometry field (geom) may appear as WKT format (e.g., POINT(4.8945 52.3667))
  • Empty fields will be empty strings in CSV

Importing Data from CSV​

Before Importing​

⚠️ Important Preparation Steps:

  1. Download a template: Export a CSV first to see the exact column names
  2. Match column headers: Ensure your CSV headers exactly match CMS field names (case-sensitive)
  3. Validate JSON fields: For types and tags, use valid JSON array syntax:
    • Correct: ["category 1", "category 2"]
    • Incorrect: category 1, category 2 (comma-separated won't work)
  4. Check coordinates: Ensure latitude and longitude are valid decimals
  5. Remove auto-generated fields: Do NOT include id, geom, or last_updated in your import CSV

Method 1: CMS CSV Import​

  1. Navigate to locator collection
  2. Click Import button (top-right)
  3. Select CSV as the format
  4. Upload your CSV file
  5. Map fields: CMS will attempt to auto-map columns to fields
    • Verify each column maps to the correct CMS field
    • Unmapped columns will be ignored
  6. Select import mode:
    • Insert: Add new rows only
    • Update: Update existing rows (requires matching key)
    • Upsert: Insert new or update existing
  7. Click Import

Method 2: Import via API (Advanced)​

For large datasets or automated imports:

curl -X POST \
https://cms.mapviewer.eu/api/items/locator/import \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: multipart/form-data' \
-F 'file=@/path/to/your/locator_data.csv' \
-F 'fields=display_name,latitude,longitude,address,city,types'

Tips and Best Practices​

Data Quality​

  1. Always verify coordinates: Use a service like LatLong.net or Google Maps to verify lat/lng
  2. Standardize address format: Use consistent format for all addresses
  3. Validate JSON arrays: Use a JSON validator for types and tags fields
  4. Country codes: Use ISO 3166-1 alpha-2 codes (NL, BE, DE, FR, etc.)

Workflow Recommendations​

  1. Small updates: Edit directly in CMS UI
  2. Multiple updates (1-50): Use batch update in CMS
  3. Large updates (50+): Export → Edit CSV → Reimport
  4. Regular syncs: Set up automated API imports for external data sources

Common Issues​

IssueSolution
CSV import failsCheck CSV encoding (use UTF-8), verify column names
JSON fields rejectedEnsure valid JSON syntax: ["value1", "value2"]
Coordinates not workingUse period as decimal separator, not comma
Geom field emptyWill be auto-generated from lat/lng
Duplicate entriesAdd store_id as unique identifier

Required Fields​

For a location to appear correctly in the locator app, at minimum provide:

  • display_name
  • latitude
  • longitude
  • types (at least one product type)

CMS Collection Configuration​

If you have admin access, you can customize the CMS collection:

Field Display Settings​

  1. Navigate to Settings > Data Model > locator
  2. Click on a field to edit its display settings
  3. Recommended configurations:
FieldDisplay TypeSettings
display_nameInputRequired: Yes
latitude, longitudeNumberPrecision: 8, Required: Yes
types, tagsJSONInterface: List (Multi-Select)
business_statusDropdownChoices: OPERATIONAL, CLOSED, TEMPORARILY_CLOSED
addressTextareaRows: 3
monday_hours - sunday_hoursInputPlaceholder: 09:00-18:00

Creating a Custom Interface​

For better usability, create a custom interface:

  1. Go to Settings > Interfaces
  2. Create new interface for locator
  3. Group related fields:
    • Location Info: display_name, store_id, address, city, zipcode, country_code
    • Contact: phone, website, email
    • Coordinates: latitude, longitude
    • Hours: All day_hours fields
    • Products: types, tags
    • Google: google_place_id, google_resource_name, google_plus_code

Example CSV Template​

store_id,display_name,address,city,zipcode,country_code,phone,website,latitude,longitude,types,tags,business_status,monday_hours
STORE-001,Main Store,Main Street 1,Amsterdam,1012 JS,NL,+31201234567,https://example.com/amsterdam,52.3667,4.8945,["category 1","category 2"],["flagship"],OPERATIONAL,09:00-18:00
STORE-002,Second Location,Side Street 45,Rotterdam,3011 AL,NL,+31109876543,,51.9225,4.4792,["category 1","category 2","category 3"],["outdoor"],OPERATIONAL,10:00-19:00

API Access (for Developers)​

Authentication​

Get your access token from Settings > Access Tokens in CMS.

List All Locations​

curl -X GET \
'https://cms.mapviewer.eu/api/items/locator?limit=-1' \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN'

Create a Location​

curl -X POST \
https://cms.mapviewer.eu/api/items/locator \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"display_name": "Store Utrecht",
"latitude": 52.0907,
"longitude": 5.1214,
"address": "Main Street 123, 3511 AL Utrecht",
"city": "Utrecht",
"country_code": "NL",
"types": ["category 1", "category 2"]
}'

Update a Location​

curl -X PATCH \
https://cms.mapviewer.eu/api/items/locator/123 \
-H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
-H 'Content-Type: application/json' \
-d '{
"business_status": "CLOSED",
"monday_hours": "10:00-17:00"
}'

Support​

For issues with:

  • CMS access: Contact your Geofacta administrator
  • Data not appearing in locator: Verify coordinates and types fields are populated
  • Import errors: Check CSV format and field mappings