Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. function addAssignmentsLayerToMap(visibility){
  2. var layerName = "All Assignments";
  3. var allYearFilter = new OpenLayers.Filter.Comparison({type: '~', property: 'startDate', value: '2013'});
  4. var allFilterStrategy = new OpenLayers.Strategy.Filter({filter: allYearFilter});
  5.  
  6. mapVars.assignmentLayer = new OpenLayers.JsonLayer(layerName, {
  7. location: '/assignments/index.json?mode=all',
  8. attributeMap: ['fullName', 'startDate', 'city']
  9. },
  10. {
  11. strategies: [
  12. new OpenLayers.Strategy.Cluster({distance:50, threshold:2, clustering:true}),
  13. allFilterStrategy
  14. ],
  15. styleMap: mapVars.clusterStyleMap
  16. });
  17.  
  18. mapVars.map.addLayer(mapVars.assignmentLayer);
  19. mapVars.assignmentLayer.setVisibility(visibility);
  20. }
  21.  
  22. strategies: [ new OpenLayers.Strategy.Cluster({distance:50}) ]
  23.  
  24. strategies: [
  25. new OpenLayers.Strategy.Cluster({distance:50}),
  26. allFilterStrategy
  27. ]
  28.  
  29. strategies: [
  30. new OpenLayers.Strategy.Cluster({distance:50, threshold:2, clustering:true}),
  31. allFilterStrategy
  32. ]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement