User Manual
Concepts
Get Started
- Pre-Requisites
- Install the NuGet Package
- Obtain Leaflet
- Obtain a License
- Initialize Mapzania
- Initialize Endpoints
- Adding a JavaScript Reference
- Add a Map to a Web Page
- Add Data to a Map
- Style a Map
- Further Reading
JavaScript Client
- Introduction
- Creating a Map Object
- Customize the Map Toolbar
- Map Events
- Mouse and Drawing Behaviour
- Map Extents
- Refresh/Reset the Map
- Working with Layers
- Displaying Layers
- Working with Layer Data
- Styling Layers
- Transforming Layers
- Working with Features
- Displaying Features
- Styling Features
- Working with the QueryEngine
DotNet Server
Working with the QueryEngine
The Mapzania QueryEngine works side-by-side with the Mapzania Map.
While they have some similarities like the ability to filter features, their distinct difference is that the QueryEngine does not generate any graphic output like the point, line and polygon layers of the Map.
Rather it operates on FeatureCollections from JavaScript objects, layer-sources or map-layers and outputs filtered FeatureCollections.
This can be handy for ad-hoc queries from a map, manipulating a feature-collection or fetching data from a layer-source to manipulate, then add to a layer.
The QueryEngine Object
The QueryEngine Object provides a number of methods for firing-off a query namely:
- usingFeatureCollection which performs querying and filtering on a client side FeatureCollection object
- usingLayerSource which performs querying and filtering on a server-side LayerSource
- usingMapLayer which performs querying and filtering on a layer that has been defined and altered in a Map object.
Example
window.onload = function () {
var map = new Mapzania.Map("map-div", "LONDON", function () {
map.addLayer("LOCAL");
map.setLayerStyle("LOCAL", {
fillColor: "#FF0000",
size: 8,
labelField: "Name"
});
map.usingLayer("WARD")
.filterByText("Like(NAME,'%T%')")
.update();
var qry = new Mapzania.QueryEngine();
qry.usingMapLayer(map, "WARD")
.convertToCentroids()
.apply()
.then(function (data) {
console.log(data);
map.addFeatureCollection("LOCAL", data);
map.updateLayer("LOCAL");
});
});
};
The following interactive example shows these methods in action: