Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function addAssignmentsLayerToMap(visibility){
- var layerName = "All Assignments";
- var allYearFilter = new OpenLayers.Filter.Comparison({type: '~', property: 'startDate', value: '2013'});
- var allFilterStrategy = new OpenLayers.Strategy.Filter({filter: allYearFilter});
- mapVars.assignmentLayer = new OpenLayers.JsonLayer(layerName, {
- location: '/assignments/index.json?mode=all',
- attributeMap: ['fullName', 'startDate', 'city']
- },
- {
- strategies: [
- new OpenLayers.Strategy.Cluster({distance:50, threshold:2, clustering:true}),
- allFilterStrategy
- ],
- styleMap: mapVars.clusterStyleMap
- });
- mapVars.map.addLayer(mapVars.assignmentLayer);
- mapVars.assignmentLayer.setVisibility(visibility);
- }
- strategies: [ new OpenLayers.Strategy.Cluster({distance:50}) ]
- strategies: [
- new OpenLayers.Strategy.Cluster({distance:50}),
- allFilterStrategy
- ]
- strategies: [
- new OpenLayers.Strategy.Cluster({distance:50, threshold:2, clustering:true}),
- allFilterStrategy
- ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement