Note:Use the ScribbleMaps Connect Picker when you want users to sign in to Scribble Maps, browse their available maps, and return map data directly to your web application.The picker opens in a popup and handles the user sign-in process there, so your application does not need to collect Scribble Maps credentials directly.
Contents
Get your Client ID
Add the SDK to your page
Open the Connect Picker
Handle the selected map data
Optional configuration
Supported formats and returned fields
How the Connect Picker works
The ScribbleMaps Connect Picker allows your users to browse, search, and select maps from Scribble Maps, then return that map data directly to your application in the format you choose.
This is useful when you want users to create or manage geodata in Scribble Maps and then load that data into your own app without building your own map browser or sign-in flow.
Use Case / Example:
This integration is useful for dashboards, property tools, field-data applications, and other web apps that need users to select and load mapped data from Scribble Maps.
Get your Client ID
-
Open the Scribble Maps developer site:
https://developers.scribblemaps.com -
Register a free project.
-
Copy your Client ID.
You will use this value when calling the Connect Picker.
Add the SDK to your page
-
In your web page, add the Connect Picker SDK:
<script src="https://api.scribblemaps.com/connect/picker.js"></script>
-
Save your page changes.
The Scribble Maps Connect Picker is now available to your application.
Open the Connect Picker
-
Call ScribbleMapsConnect.pick() from your page.
-
Pass your clientId, the export format you want, and an onSelect callback.
-
Use code similar to the following example:
ScribbleMapsConnect.pick({ clientId: 'YOUR_CLIENT_ID', format: 'geojson', onSelect: function (result) { // result.data contains your GeoJSON // result.title, result.mapCode, result.thumbUrl also available loadIntoMyApp(result.data); } });When the picker opens, the user can authenticate, browse their available maps, and select one.
Handle the selected map data
-
In the onSelect callback, access result.data.
This contains the map data in the format you requested. -
(Optional) Use the additional returned fields:
- result.title — the map title
- result.mapCode — the Scribble Maps map code
- result.thumbUrl — a thumbnail URL for the map
-
Pass the data into your application logic.
For example, load the returned GeoJSON into your own map viewer or data workflow.
Optional configuration
You can configure the picker to match your application workflow better.
-
Select the export format by changing the format value.
For example: geojson, kml, csv, gpx, dxf, shapefile, or smjson. -
Choose which map sources users can browse with the tabs option.
Users can browse maps from their personal library, team-shared maps, or the community collection. - (Optional) Use the included button styles to match a light or dark interface.
Supported formats and returned fields
Supported export formats:
- GeoJSON
- KML
- CSV
- GPX
- DXF
- Shapefile
- SMJSON
Returned result fields:
- data
- title
- mapCode
- thumbUrl
Once configured, the Connect Picker gives your users access to their Scribble Maps data directly from within your application through a single integration point.
Related
Import/Export Files & Data - GeoJSON, images, PDF, CSV, KML, GXP, SHP, DXF, SMJSON, SMT, WKT, etc.
Comments
0 comments
Article is closed for comments.