mansour raad & anthony jayaprakash - yet another mapping framework, not!
DESCRIPTION
In this session we will demonstrate the Flex Mapping API For ArcGIS Server, where we will deconstruct live real-world mapping applications and algorithms such as dense clustering, auto labeling of features, collaborative editing, real-time asset tracking and client/server collaborative Geo-Processing. In addition, we will demonstrate how to create your own layer, geometry and symbol extensions for superior rendering performance taking advantage of the FP10 drawing API.TRANSCRIPT
![Page 2: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/2.jpg)
![Page 3: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/3.jpg)
![Page 6: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/6.jpg)
![Page 7: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/7.jpg)
![Page 8: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/8.jpg)
ArcGIS Services
• Map Tiles ESRI / Virtual Earth (token)
• Geocoding / Reverse
• Query / Identify
• Routing with Barriers and Time Windows
• Buffer / Projection
• GeoProcessing
![Page 9: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/9.jpg)
You & ArcGIS
BlazePHP.Net
Local AGS
![Page 10: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/10.jpg)
Map “Hello World”
![Page 11: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/11.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<mx:Application3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. layout="absolute"6. >7. <esri:Map id="map">8. <esri:ArcGISTiledMapServiceLayer url=”http://host/rest/map”/> 9. </esri:Map> 10.</mx:Application>
Map “Hello World”
![Page 12: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/12.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<mx:Application3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. layout="absolute"6. >7. <esri:Map id="map">8. <esri:ArcGISTiledMapServiceLayer url=”http://host/rest/map”/> 9. </esri:Map> 10.</mx:Application>
Map “Hello World”
![Page 13: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/13.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<mx:Application3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. layout="absolute"6. >7. <esri:Map id="map" openHandCursorVisible="false" zoomSliderVisible="false">8. <esri:ArcGISTiledMapServiceLayer id="layer" url="{cb.selectedItem.url}"/> 9. </esri:Map>10. <mx:ComboBox id="cb" dataProvider="{[11. {label:'Imagery',url:'http://host/rest/Image'},12. {label:'Physical',url:'http://host/rest/Physical'}13. ]}"/> 14.</mx:Application>
![Page 14: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/14.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<mx:Application3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. layout="absolute"6. >7. <esri:Map id="map" openHandCursorVisible="false" zoomSliderVisible="false">8. <esri:ArcGISTiledMapServiceLayer id="layer" url="{cb.selectedItem.url}"/> 9. </esri:Map>10. <mx:ComboBox id="cb" dataProvider="{[11. {label:'Imagery',url:'http://host/rest/Image'},12. {label:'Physical',url:'http://host/rest/Physical'}13. ]}"/> 14.</mx:Application>
![Page 15: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/15.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<mx:Application3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. layout="absolute"6. >7. <esri:Map id="map" openHandCursorVisible="false" zoomSliderVisible="false">8. <esri:ArcGISTiledMapServiceLayer id="layer" url="{cb.selectedItem.url}"/> 9. </esri:Map>10. <mx:ComboBox id="cb" dataProvider="{[11. {label:'Imagery',url:'http://host/rest/Image'},12. {label:'Physical',url:'http://host/rest/Physical'}13. ]}"/> 14.</mx:Application>
![Page 16: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/16.jpg)
GeoProcessingDriveTimes
![Page 17: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/17.jpg)
![Page 18: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/18.jpg)
![Page 19: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/19.jpg)
![Page 20: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/20.jpg)
![Page 21: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/21.jpg)
1. <esri:Geoprocessor id="gp" url="<GeoProcessesorURL>" showBusyCursor="true"/>2. <esri:Map id="map" openHandCursorVisible="false" mapClick="mapClickHandler(event)">3. <esri:extent>4. <esri:Extent xmin="-95.41" ymin="38.86" xmax="-95.1" ymax="39.06">5. <esri:SpatialReference wkid="4326"/>6. </esri:Extent>7. </esri:extent>8. <esri:ArcGISTiledMapServiceLayer url="<MapServiceURL>"/>9. <esri:GraphicsLayer id="polygonLayer" graphicProvider="{gp.executeFirstFeatureSet.features}">10. <esri:renderer>11. <esri:UniqueValueRenderer attribute="ToBreak">12. <esri:UniqueValueInfo value="1">13. <esri:symbol>14. <esri:SimpleFillSymbol alpha="0.5" color="0xFF0000"/>15. </esri:symbol>16. </esri:UniqueValueInfo>17. <esri:UniqueValueInfo value="2">18. <esri:symbol>19. <esri:SimpleFillSymbol alpha="0.5" color="0x00FF00"/>20. </esri:symbol>21. </esri:UniqueValueInfo>22. <esri:UniqueValueInfo value="3">23. <esri:symbol>24. <esri:SimpleFillSymbol alpha="0.5" color="0x0000FF"/>25. </esri:symbol>26. </esri:UniqueValueInfo>27. </esri:UniqueValueRenderer>28. </esri:renderer>29. </esri:GraphicsLayer>30. <esri:GraphicsLayer id="pointLayer"/>31. </esri:Map>
![Page 22: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/22.jpg)
1. <esri:Geoprocessor id="gp" url="<GeoProcessesorURL>" showBusyCursor="true"/>2. <esri:Map id="map" openHandCursorVisible="false" mapClick="mapClickHandler(event)">3. <esri:extent>4. <esri:Extent xmin="-95.41" ymin="38.86" xmax="-95.1" ymax="39.06">5. <esri:SpatialReference wkid="4326"/>6. </esri:Extent>7. </esri:extent>8. <esri:ArcGISTiledMapServiceLayer url="<MapServiceURL>"/>9. <esri:GraphicsLayer id="polygonLayer" graphicProvider="{gp.executeFirstFeatureSet.features}">10. <esri:renderer>11. <esri:UniqueValueRenderer attribute="ToBreak">12. <esri:UniqueValueInfo value="1">13. <esri:symbol>14. <esri:SimpleFillSymbol alpha="0.5" color="0xFF0000"/>15. </esri:symbol>16. </esri:UniqueValueInfo>17. <esri:UniqueValueInfo value="2">18. <esri:symbol>19. <esri:SimpleFillSymbol alpha="0.5" color="0x00FF00"/>20. </esri:symbol>21. </esri:UniqueValueInfo>22. <esri:UniqueValueInfo value="3">23. <esri:symbol>24. <esri:SimpleFillSymbol alpha="0.5" color="0x0000FF"/>25. </esri:symbol>26. </esri:UniqueValueInfo>27. </esri:UniqueValueRenderer>28. </esri:renderer>29. </esri:GraphicsLayer>30. <esri:GraphicsLayer id="pointLayer"/>31. </esri:Map>
![Page 23: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/23.jpg)
1. <esri:Geoprocessor id="gp" url="<GeoProcessesorURL>" showBusyCursor="true"/>2. <esri:Map id="map" openHandCursorVisible="false" mapClick="mapClickHandler(event)">3. <esri:extent>4. <esri:Extent xmin="-95.41" ymin="38.86" xmax="-95.1" ymax="39.06">5. <esri:SpatialReference wkid="4326"/>6. </esri:Extent>7. </esri:extent>8. <esri:ArcGISTiledMapServiceLayer url="<MapServiceURL>"/>9. <esri:GraphicsLayer id="polygonLayer" graphicProvider="{gp.executeFirstFeatureSet.features}">10. <esri:renderer>11. <esri:UniqueValueRenderer attribute="ToBreak">12. <esri:UniqueValueInfo value="1">13. <esri:symbol>14. <esri:SimpleFillSymbol alpha="0.5" color="0xFF0000"/>15. </esri:symbol>16. </esri:UniqueValueInfo>17. <esri:UniqueValueInfo value="2">18. <esri:symbol>19. <esri:SimpleFillSymbol alpha="0.5" color="0x00FF00"/>20. </esri:symbol>21. </esri:UniqueValueInfo>22. <esri:UniqueValueInfo value="3">23. <esri:symbol>24. <esri:SimpleFillSymbol alpha="0.5" color="0x0000FF"/>25. </esri:symbol>26. </esri:UniqueValueInfo>27. </esri:UniqueValueRenderer>28. </esri:renderer>29. </esri:GraphicsLayer>30. <esri:GraphicsLayer id="pointLayer"/>31. </esri:Map>
![Page 24: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/24.jpg)
1. <esri:Geoprocessor id="gp" url="<GeoProcessesorURL>" showBusyCursor="true"/>2. <esri:Map id="map" openHandCursorVisible="false" mapClick="mapClickHandler(event)">3. <esri:extent>4. <esri:Extent xmin="-95.41" ymin="38.86" xmax="-95.1" ymax="39.06">5. <esri:SpatialReference wkid="4326"/>6. </esri:Extent>7. </esri:extent>8. <esri:ArcGISTiledMapServiceLayer url="<MapServiceURL>"/>9. <esri:GraphicsLayer id="polygonLayer" graphicProvider="{gp.executeFirstFeatureSet.features}">10. <esri:renderer>11. <esri:UniqueValueRenderer attribute="ToBreak">12. <esri:UniqueValueInfo value="1">13. <esri:symbol>14. <esri:SimpleFillSymbol alpha="0.5" color="0xFF0000"/>15. </esri:symbol>16. </esri:UniqueValueInfo>17. <esri:UniqueValueInfo value="2">18. <esri:symbol>19. <esri:SimpleFillSymbol alpha="0.5" color="0x00FF00"/>20. </esri:symbol>21. </esri:UniqueValueInfo>22. <esri:UniqueValueInfo value="3">23. <esri:symbol>24. <esri:SimpleFillSymbol alpha="0.5" color="0x0000FF"/>25. </esri:symbol>26. </esri:UniqueValueInfo>27. </esri:UniqueValueRenderer>28. </esri:renderer>29. </esri:GraphicsLayer>30. <esri:GraphicsLayer id="pointLayer"/>31. </esri:Map>
![Page 25: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/25.jpg)
1.<mx:Script>2. <![CDATA[3. import com.esri.ags.tasks.FeatureSet;4. import com.esri.ags.Graphic;5. import com.esri.ags.events.MapMouseEvent;
7. private function mapClickHandler(event:MapMouseEvent):void8. {9. const graphic:Graphic = new Graphic(event.mapPoint);10. pointLayer.clear();11. pointLayer.add(graphic);12. const featureSet:FeatureSet = new FeatureSet([graphic]);13. gp.execute({"Input_Location": featureSet, "Drive_Times": "1 2 3"});14. }15. ]]>16.</mx:Script>
![Page 26: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/26.jpg)
1.<mx:Script>2. <![CDATA[3. import com.esri.ags.tasks.FeatureSet;4. import com.esri.ags.Graphic;5. import com.esri.ags.events.MapMouseEvent;
7. private function mapClickHandler(event:MapMouseEvent):void8. {9. const graphic:Graphic = new Graphic(event.mapPoint);10. pointLayer.clear();11. pointLayer.add(graphic);12. const featureSet:FeatureSet = new FeatureSet([graphic]);13. gp.execute({"Input_Location": featureSet, "Drive_Times": "1 2 3"});14. }15. ]]>16.</mx:Script>
![Page 27: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/27.jpg)
DemoSample 1-2DriveTimes
![Page 28: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/28.jpg)
Many Children Layers
![Page 29: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/29.jpg)
Many Graphic Layers
![Page 30: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/30.jpg)
GraphicLayer
![Page 31: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/31.jpg)
GraphicLayer
• graphicProvider
• ArrayCollection
• renderer
• graphic with no symbol
![Page 32: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/32.jpg)
Graphic
![Page 33: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/33.jpg)
Graphic
• UIComponent
• Flex life cycle management
• geometry
• symbol
• attributes
![Page 34: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/34.jpg)
Graphic/Geometry
![Page 35: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/35.jpg)
Graphic/Geometry
• Geometry - base class
• MapPoint
• Polyline
• Polygon
![Page 36: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/36.jpg)
Polyline/Polygon
![Page 37: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/37.jpg)
Polyline/Polygon
• Multi Part Geometry
• Islands of Hawaii
![Page 38: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/38.jpg)
Graphic/Symbol
![Page 39: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/39.jpg)
Graphic/Symbol
• Symbol - base class
• Draws geometry of Graphic
• Uses Flash Drawing API
![Page 40: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/40.jpg)
Graphic/Attributes
![Page 41: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/41.jpg)
Graphic/Attributes
• Any Object !
• Attach any dynamic property to Graphic
![Page 42: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/42.jpg)
Geometry/Symbol
![Page 43: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/43.jpg)
Geometry/Symbol
• [Bindable] Properties
• Dispatch CHANGE event
![Page 44: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/44.jpg)
DemoSample 3-7
![Page 45: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/45.jpg)
LCDS
![Page 46: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/46.jpg)
LCDS
• Remote Objects
• Messaging
• Data Services
![Page 47: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/47.jpg)
Feature
![Page 48: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/48.jpg)
Feature
• Serializable server side object
• Properties
• featureID:int;
• geometry:IGeometry;
• attributes:ASObject;
![Page 49: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/49.jpg)
public class Feature implements Serializable{ private int m_featureId; private IGeometry m_geometry; private ASObject m_attributes;
public Feature() { }
public int getFeatureId() { return m_featureId; }
public void setFeatureId(final int featureId) { m_featureId = featureId; }
...
![Page 50: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/50.jpg)
public class MapPoint implements IGeometry{ private double m_x; private double m_y; private SpatialReference m_spatialReference;
public MapPoint(){ }
public MapPoint(final double x, final double y){ m_x = x; m_y = y; }
public double getX(){ return m_x; }
public void setX(final double x){ m_x = x; }
...
![Page 51: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/51.jpg)
DS Assembler
• fill
• createItem
• getItem
• updateItem
• deleteItem
![Page 52: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/52.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 53: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/53.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 54: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/54.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 55: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/55.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 56: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/56.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 57: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/57.jpg)
private int m_featureId = 1;private Map<Integer, Feature> m_map = new ConcurrentHashMap<Integer, Feature>(17);
public Collection fill(final List fillParameters){ return m_map.values();}
public Object getItem(final Map map){ return m_map.get(map.get("featureId"));}
public void createItem(final Object newVersion){ final Feature Feature = (Feature) newVersion; Feature.setFeatureId(m_featureId++); m_map.put(Feature.getFeatureId(), Feature);}
public void updateItem(final Object newVersion, final Object prevVersion, final List changes){ final Feature Feature = (Feature) newVersion; m_map.put(Feature.getFeatureId(), Feature);}
public void deleteItem(final Object prevVersion){ final Feature Feature = (Feature) prevVersion; m_map.remove(Feature.getFeatureId());}
![Page 58: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/58.jpg)
data-management-config.xml
![Page 59: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/59.jpg)
data-management-config.xml<destination id="feature"> <properties> <factory>spring</factory> <source>featureAssembler</source> <scope>application</scope> <use-transactions>false</use-transactions> <metadata> <identity property="featureId"/> </metadata> <network> <paging enabled="false" pageSize="10"/> </network> </properties></destination>
![Page 60: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/60.jpg)
Back To The Client :-)
![Page 61: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/61.jpg)
package com.esri.cats{ import com.esri.ags.SpatialReference; import com.esri.ags.geometry.MapPoint; import flash.net.registerClassAlias; import mx.core.IMXMLObject;
public class ClassAliasRegistry implements IMXMLObject { public function initialized(document:Object, id:String):void { registerClassAlias("com.esri.cats.MapPoint", MapPoint); registerClassAlias("com.esri.cats.SpatialReference", SpatialReference); } }}
![Page 62: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/62.jpg)
package com.esri.cats{ import com.esri.ags.SpatialReference; import com.esri.ags.geometry.MapPoint; import flash.net.registerClassAlias; import mx.core.IMXMLObject;
public class ClassAliasRegistry implements IMXMLObject { public function initialized(document:Object, id:String):void { registerClassAlias("com.esri.cats.MapPoint", MapPoint); registerClassAlias("com.esri.cats.SpatialReference", SpatialReference); } }}
![Page 63: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/63.jpg)
1.package com.esri.cats2.{3. import com.esri.ags.geometry.Geometry;
5. [Managed]6. [RemoteClass(alias="com.esri.cats.Feature")]7. public class Feature8. {9. public var featureId:int;10. public var geometry:Geometry;11. public var attributes:Object;12. 13. public function Feature()14. {15. }16. 17. } 18.}
![Page 64: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/64.jpg)
1.package com.esri.cats2.{3. import com.esri.ags.geometry.Geometry;
5. [Managed]6. [RemoteClass(alias="com.esri.cats.Feature")]7. public class Feature8. {9. public var featureId:int;10. public var geometry:Geometry;11. public var attributes:Object;12. 13. public function Feature()14. {15. }16. 17. } 18.}
![Page 65: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/65.jpg)
1.<cats:ClassAliasRegistry/>2.<mx:ArrayCollection id="features"3. collectionChange="collectionChangeHandler(event)"/>4.<mx:DataService id="ds" destination="feature"/>5.<esri:Map id="map" load="ds.fill(features)">6. <esri:GraphicsLayer id="graphicsLayer"/>7. <esri:GraphicsLayer id="pointLayer">8. <esri:symbol>9. <esri:SimpleMarkerSymbol color="0xFFFF00"/>10. </esri:symbol>11. </esri:GraphicsLayer>12.</esri:Map>
![Page 66: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/66.jpg)
1.<cats:ClassAliasRegistry/>2.<mx:ArrayCollection id="features"3. collectionChange="collectionChangeHandler(event)"/>4.<mx:DataService id="ds" destination="feature"/>5.<esri:Map id="map" load="ds.fill(features)">6. <esri:GraphicsLayer id="graphicsLayer"/>7. <esri:GraphicsLayer id="pointLayer">8. <esri:symbol>9. <esri:SimpleMarkerSymbol color="0xFFFF00"/>10. </esri:symbol>11. </esri:GraphicsLayer>12.</esri:Map>
![Page 67: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/67.jpg)
1.<cats:ClassAliasRegistry/>2.<mx:ArrayCollection id="features"3. collectionChange="collectionChangeHandler(event)"/>4.<mx:DataService id="ds" destination="feature"/>5.<esri:Map id="map" load="ds.fill(features)">6. <esri:GraphicsLayer id="graphicsLayer"/>7. <esri:GraphicsLayer id="pointLayer">8. <esri:symbol>9. <esri:SimpleMarkerSymbol color="0xFFFF00"/>10. </esri:symbol>11. </esri:GraphicsLayer>12.</esri:Map>
![Page 68: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/68.jpg)
1.<cats:ClassAliasRegistry/>2.<mx:ArrayCollection id="features"3. collectionChange="collectionChangeHandler(event)"/>4.<mx:DataService id="ds" destination="feature"/>5.<esri:Map id="map" load="ds.fill(features)">6. <esri:GraphicsLayer id="graphicsLayer"/>7. <esri:GraphicsLayer id="pointLayer">8. <esri:symbol>9. <esri:SimpleMarkerSymbol color="0xFFFF00"/>10. </esri:symbol>11. </esri:GraphicsLayer>12.</esri:Map>
![Page 69: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/69.jpg)
1.<cats:ClassAliasRegistry/>2.<mx:ArrayCollection id="features"3. collectionChange="collectionChangeHandler(event)"/>4.<mx:DataService id="ds" destination="feature"/>5.<esri:Map id="map" load="ds.fill(features)">6. <esri:GraphicsLayer id="graphicsLayer"/>7. <esri:GraphicsLayer id="pointLayer">8. <esri:symbol>9. <esri:SimpleMarkerSymbol color="0xFFFF00"/>10. </esri:symbol>11. </esri:GraphicsLayer>12.</esri:Map>
![Page 70: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/70.jpg)
private function collectionChangeHandler(event:CollectionEvent):void{ switch (event.kind) { case CollectionEventKind.RESET: doReset(event); break; case CollectionEventKind.UPDATE: doUpdate(event); break; }}
![Page 71: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/71.jpg)
private function doReset(event:CollectionEvent):void{ graphicsLayer.clear(); m_graphicsDict = new Dictionary(); for each (var feature:Feature in features) { var graphic:Graphic = new Graphic(feature.geometry, null, feature); graphic.buttonMode = true; graphic.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); graphic.toolTip = String(feature.attributes.coords).replace(" ", "\n"); graphicsLayer.add(graphic); m_graphicsDict[feature.featureId] = graphic; }}
![Page 72: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/72.jpg)
private function doReset(event:CollectionEvent):void{ graphicsLayer.clear(); m_graphicsDict = new Dictionary(); for each (var feature:Feature in features) { var graphic:Graphic = new Graphic(feature.geometry, null, feature); graphic.buttonMode = true; graphic.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); graphic.toolTip = String(feature.attributes.coords).replace(" ", "\n"); graphicsLayer.add(graphic); m_graphicsDict[feature.featureId] = graphic; }}
![Page 73: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/73.jpg)
private function doReset(event:CollectionEvent):void{ graphicsLayer.clear(); m_graphicsDict = new Dictionary(); for each (var feature:Feature in features) { var graphic:Graphic = new Graphic(feature.geometry, null, feature); graphic.buttonMode = true; graphic.addEventListener(MouseEvent.MOUSE_DOWN, mouseDownHandler); graphic.toolTip = String(feature.attributes.coords).replace(" ", "\n"); graphicsLayer.add(graphic); m_graphicsDict[feature.featureId] = graphic; }}
![Page 74: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/74.jpg)
private function doUpdate(event:CollectionEvent):void{ for each (var propertyChangeEvent:PropertyChangeEvent in event.items) { var feature:Feature = propertyChangeEvent.target as Feature; if (propertyChangeEvent.property === "geometry") { var graphic:Graphic = m_graphicsDict[feature.featureId]; if (graphic) { graphic.geometry = feature.geometry; } } }}
![Page 75: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/75.jpg)
private function doUpdate(event:CollectionEvent):void{ for each (var propertyChangeEvent:PropertyChangeEvent in event.items) { var feature:Feature = propertyChangeEvent.target as Feature; if (propertyChangeEvent.property === "geometry") { var graphic:Graphic = m_graphicsDict[feature.featureId]; if (graphic) { graphic.geometry = feature.geometry; } } }}
![Page 76: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/76.jpg)
private function doUpdate(event:CollectionEvent):void{ for each (var propertyChangeEvent:PropertyChangeEvent in event.items) { var feature:Feature = propertyChangeEvent.target as Feature; if (propertyChangeEvent.property === "geometry") { var graphic:Graphic = m_graphicsDict[feature.featureId]; if (graphic) { graphic.geometry = feature.geometry; } } }}
![Page 77: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/77.jpg)
1.private function mouseDownHandler(event:MouseEvent):void2.{3. const graphic:Graphic = event.target as Graphic;4. if (graphic)5. {6. m_feature = graphic.attributes as Feature;7. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);8. pointLayer.add(m_graphic);9. map.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);10. map.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);11. }12.}
14.private function mouseMoveHandler(event:MouseEvent):void15.{16. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);17. event.updateAfterEvent();18.}
20.private function mouseUpHandler(event:MouseEvent):void21.{22. m_feature.geometry = m_graphic.geometry; // ALL DS FM is Here :-)23. m_feature = null;24. pointLayer.clear();25. map.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);26. map.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);27.}
![Page 78: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/78.jpg)
1.private function mouseDownHandler(event:MouseEvent):void2.{3. const graphic:Graphic = event.target as Graphic;4. if (graphic)5. {6. m_feature = graphic.attributes as Feature;7. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);8. pointLayer.add(m_graphic);9. map.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);10. map.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);11. }12.}
14.private function mouseMoveHandler(event:MouseEvent):void15.{16. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);17. event.updateAfterEvent();18.}
20.private function mouseUpHandler(event:MouseEvent):void21.{22. m_feature.geometry = m_graphic.geometry; // ALL DS FM is Here :-)23. m_feature = null;24. pointLayer.clear();25. map.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);26. map.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);27.}
![Page 79: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/79.jpg)
1.private function mouseDownHandler(event:MouseEvent):void2.{3. const graphic:Graphic = event.target as Graphic;4. if (graphic)5. {6. m_feature = graphic.attributes as Feature;7. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);8. pointLayer.add(m_graphic);9. map.addEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);10. map.addEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);11. }12.}
14.private function mouseMoveHandler(event:MouseEvent):void15.{16. m_graphic.geometry = map.toMapFromStage(event.stageX, event.stageY);17. event.updateAfterEvent();18.}
20.private function mouseUpHandler(event:MouseEvent):void21.{22. m_feature.geometry = m_graphic.geometry; // ALL DS FM is Here :-)23. m_feature = null;24. pointLayer.clear();25. map.removeEventListener(MouseEvent.MOUSE_MOVE, mouseMoveHandler);26. map.removeEventListener(MouseEvent.MOUSE_UP, mouseUpHandler);27.}
![Page 80: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/80.jpg)
Demo CATS
![Page 81: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/81.jpg)
“Lots” Features
![Page 82: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/82.jpg)
![Page 83: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/83.jpg)
Spatial Index
![Page 84: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/84.jpg)
Spatial Index
• RTree
• QuadTree
• Grid / Trellis
• Simple
• Efficient (points)
• Good enough !
![Page 85: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/85.jpg)
![Page 86: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/86.jpg)
0,0
width,height
![Page 87: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/87.jpg)
0,0
width,height
Xmin,Ymin
Xmax,Ymax
![Page 88: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/88.jpg)
0,0
width,height
Xmin,Ymin
Xmax,Ymax
![Page 89: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/89.jpg)
0,0
width,height
Xmin,Ymin
Xmax,Ymax
![Page 90: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/90.jpg)
0 1 2 3
0
1
2
3
Cx
Cy
![Page 91: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/91.jpg)
0 1 2 3
0
1
2
3
(0,0)
(1,3)
(3,2)
(3,2)
Cx
Cy
![Page 92: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/92.jpg)
Cx & Cy > 0 int
![Page 93: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/93.jpg)
Cx & Cy < 216
![Page 94: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/94.jpg)
Dict[(cx<<16)|cy]
![Page 95: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/95.jpg)
Cluster : Geometry
![Page 96: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/96.jpg)
Cluster : Geometry
• Original X
• Original Y
• Cluster X
• Cluster Y
• count
![Page 97: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/97.jpg)
ClusterSymbol : Symbol
![Page 98: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/98.jpg)
ClusterSymbol : Symbol
• Draws a Cluster geometry instance
• Flash drawing API
• beginFill - based on cluster count
• drawRoundedRect - based on Cx,Cy
![Page 99: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/99.jpg)
DemoDrawSymbol Code
![Page 100: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/100.jpg)
![Page 101: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/101.jpg)
Adaptive Clustering
![Page 102: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/102.jpg)
Adaptive Clustering
• JIT
• “Smart” algorithm - all client side.
• React to map extent change
![Page 103: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/103.jpg)
![Page 104: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/104.jpg)
Given set of map points
![Page 105: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/105.jpg)
Given set of map pointsAssign map point to cluster set
![Page 106: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/106.jpg)
Given set of map pointsAssign map point to cluster setdo
![Page 107: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/107.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters
![Page 108: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/108.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
![Page 109: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/109.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
![Page 110: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/110.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
if Cj is close enough to Ci
![Page 111: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/111.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
if Cj is close enough to Ci
assign Cj map points to Ci
![Page 112: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/112.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
if Cj is close enough to Ci
assign Cj map points to Ci
remove Cj from cluster set
![Page 113: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/113.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
if Cj is close enough to Ci
assign Cj map points to Ci
remove Cj from cluster set adjust Ci location
![Page 114: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/114.jpg)
Given set of map pointsAssign map point to cluster setdo spatial index clusters for each cluster Ci
find adjacent clusters Cj
if Cj is close enough to Ci
assign Cj map points to Ci
remove Cj from cluster set adjust Ci locationrepeat while overlapping clusters exist
![Page 115: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/115.jpg)
Adjusting Ci location
![Page 116: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/116.jpg)
Adjusting Ci location
Ci
Wi
![Page 117: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/117.jpg)
Adjusting Ci location
Ci
Wi
Cj
Wj
![Page 118: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/118.jpg)
Adjusting Ci location
Ci
Wi
Cj
Wj
![Page 119: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/119.jpg)
Adjusting Ci location
Wi+Wj
Ci=(Ci Wi+CjWj)/WiWj
![Page 120: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/120.jpg)
DemoClusterApp
![Page 121: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/121.jpg)
![Page 122: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/122.jpg)
HeatMaps are Bitmaps !
![Page 123: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/123.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<view:PrepApplication3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. xmlns:controller="com.esri.controller.*"6. xmlns:view="com.esri.view.*"7. layout="vertical"8. paddingLeft="0"9. paddingRight="0"10. paddingTop="0"11. paddingBottom="0"12. >13. <controller:LoadCommand/>14. <view:PrepSlider/>15. <view:PrepMap>16. <view:extent>17. <esri:Extent xmin="-143.141073" ymin="14.930875" xmax="-48.0570833" ymax="57.649769"/>18. </view:extent>19. <esri:ArcGISTiledMapServiceLayer20. url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>21. <view:PrepLayer/> 22. </view:PrepMap>23.</view:PrepApplication>
![Page 124: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/124.jpg)
1.<?xml version="1.0" encoding="utf-8"?>2.<view:PrepApplication3. xmlns:mx="http://www.adobe.com/2006/mxml"4. xmlns:esri="http://www.esri.com/2008/ags"5. xmlns:controller="com.esri.controller.*"6. xmlns:view="com.esri.view.*"7. layout="vertical"8. paddingLeft="0"9. paddingRight="0"10. paddingTop="0"11. paddingBottom="0"12. >13. <controller:LoadCommand/>14. <view:PrepSlider/>15. <view:PrepMap>16. <view:extent>17. <esri:Extent xmin="-143.141073" ymin="14.930875" xmax="-48.0570833" ymax="57.649769"/>18. </view:extent>19. <esri:ArcGISTiledMapServiceLayer20. url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_Imagery_World_2D/MapServer"/>21. <view:PrepLayer/> 22. </view:PrepMap>23.</view:PrepApplication>
![Page 125: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/125.jpg)
PrepLayer : Layer
![Page 126: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/126.jpg)
PrepLayer : Layer
• Subclass Layer
• Override updateLayer
• Invoked by updateDisplayList
• create bitmap - lock/unlock
• bitmap.fillRect each heat map point
• graphic.bitmapFill / drawRect
![Page 127: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/127.jpg)
PrepLayer
![Page 128: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/128.jpg)
PrepLayer
• Kept data in 2 arrays
• x = []
• y = []
• Easy to AMF
• toScreenX/Y built-in functions
![Page 129: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/129.jpg)
DemoPrecipitationApp
![Page 130: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/130.jpg)
![Page 131: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/131.jpg)
Street Tracing
![Page 132: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/132.jpg)
Street Tracing
• A*
• Create nodes and edges
• Define barriers
• Reverse geocoding
• Custom layer - faster rendering
![Page 133: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/133.jpg)
A* / Path Finding
![Page 134: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/134.jpg)
Streets
![Page 135: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/135.jpg)
Streets
![Page 136: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/136.jpg)
“Street” Graph
![Page 137: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/137.jpg)
“Street” Graph
• Intersection - nodes
• Street Segment - edge
• Travel distance or time - cost
![Page 138: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/138.jpg)
Nodes/Edges/Barriers
![Page 139: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/139.jpg)
Nodes/Edges/Barriers
A
B
C
D
E
![Page 140: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/140.jpg)
Nodes/Edges/Barriers
A
B
C
D
E
![Page 141: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/141.jpg)
Nodes/Edges/Barriers
A
B
C
D
E
![Page 142: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/142.jpg)
Street Info
Main St
![Page 143: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/143.jpg)
Street Info
Main St
100
200
![Page 144: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/144.jpg)
Street Info
Main St
100101
200199
![Page 145: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/145.jpg)
ReverseGeocoding
![Page 146: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/146.jpg)
ReverseGeocoding
Main StLeft 100-200Right 101-199
![Page 147: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/147.jpg)
ReverseGeocoding
t
Main StLeft 100-200Right 101-199
![Page 148: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/148.jpg)
ReverseGeocoding
t
Main StLeft 100-200Right 101-199
![Page 149: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/149.jpg)
ReverseGeocoding
dt
Main StLeft 100-200Right 101-199
![Page 150: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/150.jpg)
ReverseGeocoding
dt
Main StLeft 100-200Right 101-199
153 Main St
![Page 151: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/151.jpg)
Distance Calculations
![Page 152: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/152.jpg)
Distance Calculations
A
B
C
![Page 153: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/153.jpg)
Distance Calculations
A
B
C
P
![Page 154: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/154.jpg)
Distance Calculations
A
B
C
Pr
r=AC AB•
∣AB∣2
![Page 155: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/155.jpg)
Distance Calculations
A
B
C
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤
![Page 156: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/156.jpg)
Distance Calculations
A
B
C
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
![Page 157: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/157.jpg)
Distance Calculations
Ax Bx Cx
Ay By Cy
12
A=
A
B
C
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
![Page 158: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/158.jpg)
Distance Calculations
Ax Bx Cx
Ay By Cy
12
A=
A
B
C
height
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
![Page 159: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/159.jpg)
Distance Calculations
Ax Bx Cx
Ay By Cy
12
A=
A
B
C
base
height
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
![Page 160: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/160.jpg)
Distance Calculations
A=base×height
2
Ax Bx Cx
Ay By Cy
12
A=
A
B
C
base
height
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
![Page 161: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/161.jpg)
Distance Calculations
A=base×height
2
Ax Bx Cx
Ay By Cy
12
A=
A
B
C
base
height
Pr
r=AC AB•
∣AB∣2
r≺0 beyond A ↤r≻0 beyond B ↦
AP=rAB
![Page 162: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/162.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 163: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/163.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 164: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/164.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 165: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/165.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 166: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/166.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 167: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/167.jpg)
1.override protected function updateLayer():void{2. const model:Model = Model.instance;3. graphics.clear();4. graphics.lineStyle(1, 0);5. model.streetGrid.search(map.extent, streetHandler);6.}
8.private function streetHandler(street:Street, data:Object = null):void{9. for each(var path:Array in street.shpPolyline.paths){10. var index:int = 0;11. var lastX:Number = toScreenX(path[index++]);12. var lastY:Number = toScreenY(path[index++]);13. graphics.moveTo(lastX, lastY);14. while(index < path.length){15. var currX:Number = toScreenX(path[index++]);16. var currY:Number = toScreenY(path[index++]);17. if( currX !== lastX || currY !== lastY){18. graphics.lineTo(currX, currY);19. lastX = currX;20. lastY = currY; 21. }22. }23. }24.}
![Page 168: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/168.jpg)
DemoStreetTrace
![Page 169: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/169.jpg)
When Will I Use This ?
![Page 170: Mansour Raad & Anthony Jayaprakash - Yet Another Mapping Framework, NOT!](https://reader034.vdocument.in/reader034/viewer/2022051611/54b48b1a4a7959d6068b4589/html5/thumbnails/170.jpg)
Q&Ahttp://thunderheadxpler.blogspot.com