Getting started
Create an app
Go to Troop Marketplace and click on My Integrations.
Click Create App. A modal window will open.
Select type API import.
Edit the basic information of your app and click Next.
For API imports, the supported app types/subtypes are Geographic Area and Geographic Location. Check the introduction for more information on how to choose type and subtype.
Save the app ID and API key, that you will need to manipulate the app data.
For security reasons, you won't be able to see the API key again, so make sure you save it.
Click Next. You app is ready to be manipulated.
Import data for your app
Read the Model Reference to understand the difference between an App, a Feature and a Feature property.
It's important that you understand the model of the Troop Marketplace before manipulating data. Reading it will take you less than 5 minutes.
Use our Graphql API to import data into your app. See the Graphql schema.
Create/update/delete features with
createOneFeature
,createManyFeatures
,updateOneFeature
,deleteOneFeature
anddeleteManyFeatures
.If your app subtype is Geographic Area:
title
and at least one ofcountry
,region
orcity
are required fields for your features.If your app subtype is Geographic Location:
title
,type
andcoordinates
are required fields for your features.
Create/update/delete feature properties with
createOneFeatureProperty
,createManyFeatureProperties
,updateOneFeatureProperty
,deleteOneFeatureProperty
anddeleteManyFeatureProperties
.Add custom feature properties. For example:
For an app representing country risk (subtype Geographic Area): feature properties with name
risk_level
,risk_description
...For an app representing meeting spaces (subtype Geographic Location: feature properties with name
address
,email
,phone_number
,link
...
Optionally, add feature properties to customize the colors: feature properties with name
fill_color
andline_color
. See more details in the Model Reference.Optionally, add feature properties to customize the shapes, in case your app subtype is Geographic Location: feature properties with name
circle_radius
andcircle_border_width
. See more details in the Model Reference.Optionally, add feature properties to customize the legend: feature properties with name
legend_title
,legend_description
andphotos
. See more details in the Model Reference.
Update the map with
updateTilesetSource
.
After creating/updating features and feature properties, you will need to execute a specific mutation to update the map: updateTilesetSource
. Otherwise, the data will be imported, but the map will not update.
Check that your map is up to date.
Once the sync is successful, it will take up to 15 minutes for the data to reflect on your map, due to caching.
Examples
Check the examples at Examples.
Last updated