Examples
This page contains some basic examples that demonstrate the capabilities of the NPMap library. Each example contains a working map and a view of the source code that was used to create the map. Most of these examples will run, as is, if downloaded to your local machine or web server, so they can be used as a starting point for building your own web map.
If you’re looking for more advanced or functional examples of the types of maps NPMap can be used to build, take a look at the gallery.
Loading gallery...
-
ArcGisServerRest (Dynamic)
- layers
Demonstrates adding a dynamically-generated
ArcGisServerRestlayer to your map. -
ArcGisServerRest (Identify Related Records)
- layers
This example demonstrates how to bring in related data from an ArcGIS Server REST service and display it in the
InfoBox. -
ArcGisServerRest (Toggle SubLayers)
- layers
Shows how to toggle an
ArcGisServerRestlayer's sublayers on and off. -
Base Layers
- layers
This example shows some of the different base layers you can bring into NPMap. It also demonstrates the base layer switcher tool.
-
Load Events
- map
This example demonstrates hooking up to the two NPMap load events: preinit and init. These events enable developers to hook up custom functionality to their map.
-
Map Defaults
- map
Demonstrates the default map configuration for each base API. A NPMap map can be created simply by specifying as few as two configuration properties.
-
Showing Instagram Photos on a Map
- cases
- layers
This example shows how to display recent photos posted to Instagram on a map.
-
TileStream (Advanced)
- layers
This example demonstrates how to use some of the advanced features of a TileStream server like compositing and interactivity. NPMap supports all of the features of a TileStream server, so you get all of these features, out of the box, when you add one or more TileStream layers to your map.
-
Using SPOT Satellite Messengers
- layers
This example shows how you can bring a JSON feed generated by a SPOT device into an NPMap web map.
-
Zoomify with Automatic Extent
- layers
Add a Zoomify layer to your web map and automatically zoom to its extent.