Find more Examples here

FilterClusterLayer (Map-API)

Version reduced to minimal set of HTML Read Example Description

Description

The FilterClusterLayer adds a filtered set of tours of an outdooractive API project to the map. The markers of the result set are merged to cluster markers if necessary just like the standard ClusterLayer does.

oa.api.maps( initOAX );

function initOAX( oamaps, gm ) {

    // map configuration
    var config = {
        center : new gm.LatLng( 47.54687, 10.2928 ),
        zoom : 10,
        mapTypeId : 'oa_map',
        mapTypeControlOptions : { mapTypeIds: ['oa_map', 'oa_topo', 'oa_map_winter'] }
    };

    // instantiate map
    map = oamaps.map( document.getElementById("map_canvas"), config );

    // instantiate FilterClusterLayer
    layer = new oamaps.FilterClusterLayer( { 
            
	// Full Text Search for 'Kirche', tours with 5000 <= length <= 20000
	initFilter : { q:'Kirche', len_s:5000, len_e:20000 }

    });
 
    // listen on clicks on info windows
    var h = layer.listen( 'iwSelect', openDetailPage );
     
    // add FilterClusterLayer to map
    layer.setMap( map );

}

// open a detail page
function openDetailPage( obj ) {
    return window.location = "../../FlexView-API/FlexView.DetailPage.html?id=" + obj.id;
}

Filter Parameter

The FilterClusterLayer allows you to filter all tours of your project by the following parameters.

Parameter Example Default Description
dif_d, dif_m, dif_e dif_d : false true show tours which are ‘difficult’ (dif_d=true), ‘intermediate’ (dif_m=true), ‘easy’ (dif_e=true)
asc_s, asc_e asc_s : 500 empty string filter tours by ascending meters: asc_s <= tour.asc <= asc_e
tim_s, tim_e tim_e : 60 empty string filter tours by duration in minutes: tim_s <= tour.time <= tim_e
len_s, len_e len_e : 5000 empty string filter tours by length in meters: len_s <= tour.length <= len_e
q q : ‘Church’ empty string full text search
area area : ‘1027459’ empty string filter by region
category category : ‘1566479’ empty string filter by category
sortedBy sortedBy : ‘title’ empty string sort output by ‘title’ or ‘distance’. Use ‘title desc’ to sort in descending order.