Crater Lake National Park

NPMap

Digital maps for the National Park Service

Upgrading

The NPMap team strives to keep new versions of the library backwards-compatible. There are times, however, when changes to the library necessitate manual upgrade steps.

These notes document any manual upgrade steps required for each release.

Upgrading to 1.0.0

The 1.0.0 release is the first major release of NPMap. It includes a fully-documented API, as well as a number of significant changes in how the library is laid out. The following changes may affect your application if it was built with a previous release of NPMap:

  1. jQuery is no longer used by NPMap, so if you want to use jQuery with NPMap going forward, you'll need to include it in your web page yourself.
  2. The way default baseLayers are defined for a map has changed. Take a look at the base layers example for more information.
  3. The Esri base API and NativeVectors layer handler have been deprecated. If you are using either of these, you will need to migrate your map to a new base API and/or the Json layer handler, respectively.
  4. The restrictZoom config is now named zoomRange.
  5. If you are using either the Bing or Google base API and you are not an NPS employee, partner, or contractor, you now need to specify the NPMap.config.credentials config property. More information is available in the Bing and Google documentation.
  6. Lat/lngs are no longer defined as strings. They are now defined as objects: {lat: 36, lng: -93}. The primary place you will need to change this is in the NPMap.config.center property, if set.

As always, if you need help migrating your map to the new version, send us an email: (npmap@nps.gov). We are happy to help!

Old Upgrade Notes

Upgrading to 0.7.2

The 0.7.2 release introduced the NPMap.config object and deprecated the web map config file. Because of this, upgrading to 0.7.2 from a previous release requires the migration of config properties into the new structure. In most cases, the names of config properties remained the same, but simply need to be migrated into the NPMap.config object.

For example, in the old web map config file the base API was defined like this:


NPMap.api = 'bing';

In the new NPMap.config object, the base API (and all of the other configuration properties) are nested in the NPMap.config object. So the base API is now defined like this:


NPMap.config = {
  api: 'bing'
};