Guest User

Untitled

a guest
Jan 16th, 2019
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.21 KB | None | 0 0
  1. const farArcade = `
  2. var buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
  3.  
  4. var grossFloorArea = 0;
  5. for (var building in buildingFootprints){
  6. var floors = IIF(building.FLOORCOUNT == 0, 1, building.FLOORCOUNT);
  7. grossFloorArea += ( AreaGeodetic( Intersection(building, $feature), 'square-feet') * floors );
  8. }
  9.  
  10. Round( ( grossFloorArea / AreaGeodetic($feature, 'square-feet') ), 1);
  11. `;
  12.  
  13. // Loads the necessary resources for the expression including the
  14. // geometry engine and permits async execution of the script
  15. popupProfile.initialize( [ farArcade ] ).then(function(){
  16. // loads layers from a webmap with the given id
  17. arcgisUtils.createMap("da634028a734418f8a5416c675559c3a", "map")
  18. .then(function (response) {
  19. const map = response.map;
  20. const layerIds = map.graphicsLayerIds;
  21. const layer = map.getLayer(layerIds[1]);
  22.  
  23. // Reference the expression in the popup template and set it on the parcels layer
  24. layer.setInfoTemplate( new PopupTemplate({
  25. description: "Floor Area Ratio (FAR): {expression/far}",
  26. expressionInfos: [{
  27. name: "far",
  28. title: "far",
  29. expression: farArcade
  30. }]
  31. }) );
  32. });
  33. });
Add Comment
Please, Sign In to add comment