-3

How to develop a Swipe tool for rasters or vectors (Spatial layer) like openlayers or ErdasImagine. Can any one give me the references please

closed as too broad by Midavalo, PolyGeo May 11 '16 at 10:17

Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.

  • As per the Tour there should only be one question per question and by asking the same question for multiple products this is effectively multiple questions. – PolyGeo May 11 '16 at 10:18
3

In OpenLayers Swipe Control is easy enough to use, the following code should set you up:

var map;
var swipe;

function init() {

    map = new OpenLayers.Map({
        div : "map",
        allOverlays : true
    });

    var osm = new OpenLayers.Layer.OSM();
    var gmap = new OpenLayers.Layer.Google("Google Streets");

    map.addLayers([ osm, gmap ]);

    swipe = new OpenLayers.Control.Swipe(osm);

    map.addControl(swipe);

    map.setCenter(new OpenLayers.LonLat(10.2, 48.9).transform(new OpenLayers.Projection("EPSG:4326"), map.getProjectionObject()), 9);
}

function toggleControl(element) {
    if (element.checked) {
        swipe.activate();
    } else {
        swipe.deactivate();
    }
}

Another example of swipe control in OpenLayers is this, and this.

This question is also a bit similar.

  • what is the function code for swipe.active() and swipe.deactive() ? – Satya Chandra May 11 '16 at 11:00

Not the answer you're looking for? Browse other questions tagged or ask your own question.