The GC2 JavaScript API is a thin wrapper around Leaflet. It makes it easy to initiate a Leaflet map with tile and vector overlays from a GC2 server. Also it defines commonly used base layers from providers like OSM, Google, Bing, HERE, Yandex and Stamen.
The GC2 JavaScript Widget is a ready-for-use embeddable widget for web-pages. It adds legend and click-info to the map and have i18n support. It loads the layer meta data from the GC2 server and uses the titles, click-info setups etc. The widget can be extended through the GC2 JavaScript API.
Basic example. Map with a base layer and a tile overlay. An tile overlay can be refereed to as [schema].[table]
Map with multiple base layers and tile overlays with custom titles. The API defines several base layers. If Google Maps are used, the API will asynchronously load the Google Maps API.
Map with vector overlay from a SQL store. The store loads data as GeoJSON defined by a SELECT query.
Load polygon vectors from a SQL store and add custom classified style map.
The GC2 API, Leaflet and all other scripts and stylesheets can be loaded asynchronously.
Basic example. With one tile layer and default base layers of the GC2 server
Widget with multiple tile layers and custom set of base layers.
Access the geocloud and native Leaflet object using the callback function.