Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const farArcade = `
- var buildingFootprints = Intersects($feature, FeatureSetByName($map, "Building Footprints"));
- var grossFloorArea = 0;
- for (var building in buildingFootprints){
- var floors = IIF(building.FLOORCOUNT == 0, 1, building.FLOORCOUNT);
- grossFloorArea += ( AreaGeodetic( Intersection(building, $feature), 'square-feet') * floors );
- }
- Round( ( grossFloorArea / AreaGeodetic($feature, 'square-feet') ), 1);
- `;
- // Loads the necessary resources for the expression including the
- // geometry engine and permits async execution of the script
- popupProfile.initialize( [ farArcade ] ).then(function(){
- // loads layers from a webmap with the given id
- arcgisUtils.createMap("da634028a734418f8a5416c675559c3a", "map")
- .then(function (response) {
- const map = response.map;
- const layerIds = map.graphicsLayerIds;
- const layer = map.getLayer(layerIds[1]);
- // Reference the expression in the popup template and set it on the parcels layer
- layer.setInfoTemplate( new PopupTemplate({
- description: "Floor Area Ratio (FAR): {expression/far}",
- expressionInfos: [{
- name: "far",
- title: "far",
- expression: farArcade
- }]
- }) );
- });
- });
Add Comment
Please, Sign In to add comment