Upgrading to NPMap.js (any version of NPMap >= 2.0.0) from an old version of the NPMap library (any version < 2.0.0) requires some minor changes.
The NPMap variable no longer needs a config
property, and it can now be either an object (one map) or an array (multiple maps).
Legacy:
var NPMap = {
config: {
div: 'map'
}
};
NPMap.js:
var NPMap = {
div: 'map'
};
var NPMap = [{
div: 'map1'
},{
div: 'map2'
}];
The zoomRange
property is no longer an object and is now broken up into two individual properties: minZoom
and maxZoom
.
Legacy:
...
zoomRange: {
max: 15,
min: 7
}
NPMap.js:
...
minZoom: 7,
maxZoom: 15
Some more notes:
- The
api
config property is no longer needed and will be ignored, if provided - The
events
config property is now namedhooks
- The
InfoBox
config property is now namedpopup
- The
layers
config property is now namedoverlays
- The
TileStream
layer handler is now namedmapbox
- The
tools
config property has been deprecated. "Tools" are now called "Controls", and they can be added as individualBoolean
orObject
configs. Take a look at the examples for more information. - The
type
property forbaselayers
andoverlays
should now be defined in lowercase (GeoJson
is nowgeojson
,Kml
is nowkml
, etc.)
And that is it! Migrating should be fairly straightforward and painless. If you need help, send an email to the NPMap team. We are happy to help.