Select to view content in your preferred language

Can you Display a  polygon with CSVLayer or Graphic offline

1611
7
12-12-2013 06:39 AM
AronHarris
Emerging Contributor
I am writing a application to collect gis data offline. Is there a way to display polygons offline in a flex air. I am using tpk to display the base map. I am using sqlite as my database to capture point and then display them back as an graphic using the Lat/Long. Does anyone have any ideas....

Thanks
Tags (2)
0 Kudos
7 Replies
RobertScheitlin__GISP
MVP Emeritus
Aron,

   Not sure I understand your question completely... Yes, you can display polygon graphics when offline, just like you are displaying point data.
0 Kudos
AronHarris
Emerging Contributor
The way I do it is to read data out off my SQLite database use this function to display it
[Bindable]
public var bridgeList:Object;
        private function bridgeResult():void {
  [Embed(source='assets/point.png')]
  var bridgePicClass:Class;
  var bridgePoint:PictureMarkerSymbol = new PictureMarkerSymbol(bridgePicClass);
            for (var i:int; i < this.employeeCollection.length; i++) {
    var bridgeGraphic:Graphic = new Graphic(new WebMercatorMapPoint(employeeCollection.GPSLong, employeeCollection.GPSLat), bridgePoint);
 
    bridgePointsLayer.add(bridgeGraphic);
    }

How would I do it for polygons?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Aron,

   Polygons have Ring(s) which are just an array of MapPoints. So you just add the points that make up the polygon using the addRing function.

https://developers.arcgis.com/en/flex/api-reference/com/esri/ags/geometry/Polygon.html
0 Kudos
AronHarris
Emerging Contributor
On a point feature class I added the long/lat to the table and put the table in a SQLite database. How would I do it with a polygon feature class.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Aron,

   Is your question about adding your polygon data in SQLite?.. If you have a polygon then you loop through all the rings and for each ring loop through all the points and write the points to the table (you decide how to keep track of what ring and what polygon the points belong to, likely creating a unique polygonID to add to a polygon field and same for rings).
0 Kudos
AronHarris
Emerging Contributor
Yes, adding polygon data in SQLite.
Sorry I did clarify more on what I am doing. I am making an application to be used on an android tablet out in the field offline with Adobe Air. The department will be collection point and I am trying to figure out the best way to display polygons on the map besides using TPK. Do you have any other ideas

I just want make sure I got this. I would querytask the polygon  in flex air and write the data into a SQLite table then later I can draw it from that table.

Thanks....
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Aron,

  
I would querytask the polygon  in flex air and write the data into a SQLite table then later I can draw it from that table
Sure that would work.
0 Kudos