You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: map-api.md
+8-21Lines changed: 8 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -7,19 +7,15 @@ parent: Maps
7
7
8
8
# Map APIs and embeds
9
9
10
-
This section is for people who want to integrate the Probable Futures maps into their own websites or applications. It is possible to achieve thisin three ways:
10
+
This section describes how to integrate the Probable Futures maps into any website or application. Typically, there are two ways people prefer to do this. If a map will be added to an article, embeddable maps downloaded directly from the Probable Futures website are a simple and efficient option. If the maps will be used in an application, where the maps will change dynamically, one of the two map API packages work best. For more customization options, see the [map customizations page](/map-customization).
11
11
12
-
1. Use the map APIs (npm packages) to integrate the maps into your own application, for example if you are creating an application where you will display more than one map.
13
-
2. Download an embeddable map, for example to display a map in an article.
14
-
3. Customize, restyle, and host the maps with your own Mapbox account, for example if you would like to use different colors or bins on the maps.
12
+
## Embeddable maps - downloaded from probablefutures.org
15
13
16
-
### Use cases
14
+
1. On [probablefutures.org/maps](https://probablefutures.org/maps), position the map location and zoom level exactly as you would like it to appear in the embed.
15
+
2. Click the download button on the right side. In the pop-up, select between either a standard embeddable map or embeddable comparison map. When you are done choosing your options, click the download button to download the embeddable map as an HTML file.
16
+
3. Add the file to any website. Typically, it's best to do this by placing the contents of the HTML file inside an `<iframe>` element.
17
17
18
-
These maps APIs can be used to:
19
-
20
-
- Add clear and compelling visual maps of our changing climate to any website, article, story, or app
21
-
- Show any place in the world, at any zoom level
22
-
- Do the above for a single warming scenario or multiple, in comparison or sequentially
18
+
<divid="compare-map-container"></div>
23
19
24
20
## Embeddable maps API - using React
25
21
@@ -42,18 +38,9 @@ This package offers an HTML generator that creates pure HTML versions of the Pro
42
38
43
39
Learn more about this package and find installation instruction in [the npm registry: @probable-futures/probable-futures-maps-html-generator](https://www.npmjs.com/package/@probable-futures/probable-futures-maps-html-generator).
44
40
45
-
## Embeddable maps - direct download
46
-
47
-
1. Go to [probablefutures.org/maps](https://probablefutures.org/maps).
48
-
2. Navigate the map to a place in the world that you would like to show in the embeddable map.
49
-
3. Click the download button on the top right.
50
-
4. Select "Download as embeddable map" or "Download as embeddable comparison map". If selecting a standard embeddable map, the warming scenario you are viewing will be shown in the embeddable map. If selecting a comparison map, choose the warming scenarios you would like to include in the embeddable map in the next step.
51
-
5. Click the download button to download the embeddable map file.
52
-
6. Add the file to any website, application, or article.
53
-
54
-
## Demo
41
+
### Demo: Generating a climate map using a map API package
The code below uses the`@probable-futures/probable-futures-html-generator` package to generate a map. You can edit the code and click the "Save and Run Code" button to change the map. For example, change the `datasetID` to change the type of map being shown, change the `zoom` to change the zoom of the map, and change the `latitude` or `longitude` to change the center focus of the map.
0 commit comments