1.0.16 • Published 3 days ago

@probable-futures/probable-futures-maps v1.0.16

Weekly downloads
-
License
ISC
Repository
-
Last release
3 days ago

@probable-futures/probable-futures-maps

This package empowers developers to seamlessly integrate dynamic and interactive climate maps into their web applications

Installing

Using npm: npm install @probable-futures/probable-futures-maps

Using yarn: yarn add @probable-futures/probable-futures-maps

Example

import { generateEmbedMap } from "@probable-futures/probable-futures-maps";
import * as fs from "fs";

const htmlTemplate = await generateEmbedMap({
  datasetId: 40101,
  viewState: {
    zoom: 4
  },
  scenario: 2
});

// Do whatever you want with the html template, eg. write it to an html
// file or render it in inside an html iframe.

const fullPath = "./output.html";

fs.writeFileSync(fullPath, htmlTemplate);

Config

  • generateEmbedMap: This function can be used to generate embeddable maps as an html-string template. It takes the following parameters:

    • datasetId: The id of the dataset associated to each map. The list can be found in the docs
    • tempUnit: °C or °F. If the map unit is a temperature unit, eg. "Average Tempareture" map, you can choose the initial unit for the map data. Note that unit can still be changed from the map key.
    • scenario: The warming scenario
    • viewState: This is an object which defines the initial view port of the map. The object includes longitude, latitude, and zoom
    • compare: This object can be specified in case the user wants to generate a comparison embeddable map. The object fields are scenarioBefore and scenarioAfter
1.0.16

3 days ago

1.0.11

6 days ago

1.0.10

6 days ago

1.0.15

5 days ago

1.0.14

6 days ago

1.0.13

6 days ago

1.0.12

6 days ago

1.0.9

28 days ago

1.0.8

1 month ago

1.0.7

1 month ago

1.0.6

2 months ago

1.0.5

2 months ago

1.0.4

6 months ago

1.0.3

7 months ago

1.0.2

7 months ago

1.0.1

8 months ago

1.0.0

9 months ago