User Manual

Displaying Features

The Feature Object provides a number of methods for setting a feature's display namely:


show/hide

The show and hide methods change the visibility of the feature (regardless if it was created on the client or provided by the server).


window.onload = function () {
    var map = new Mapzania.Map("map-div", "LONDON", function () {
        map.usingLayer("SIGHTS")
        	.usingFeature("22")
            	.hide()
            	.update();

        map.usingLayer("SIGHTS")
        	.usingFeature(25)
            	.show()
            	.update();           
    });
};

update

The update method will redraw the layer once a number of changes have been made to the feature.


window.onload = function () {
    var map = new Mapzania.Map("map-div", "LONDON", function () {
        map.usingNewLayer("MY_LAYER")
            .addFeatureCollection(features)
            .usingFeature("22)
	            .style({ fillColor: "#000000" })
	            .update();
    });
};

The following interactive example shows this in action: