|
POST
|
Sebastian, There are no any documentation from ESRI developers, where Segment is not a Geometry! Also no any documentation about "witch Geometries types can be used with Graphic". Finally: So, for graphics you should use Point, Polyline or Polygon. you right, but I did not find any documentation about it.
... View more
01-19-2012
10:49 PM
|
0
|
0
|
924
|
|
POST
|
mggl, Unfortunately I can not compile your code now, but try to use Polyline when creating a Graphic. try
{
Segment segment = new Line();
segment.setStart(startPoint);
segment.setEnd(endPoint);
Log.d("SEGMENT", "x: " + segment.getStartX() + "y: " + segment.getStartY());
Polyline pLine = new Polyline();
pLine.addSegment(segment, true);
Symbol lineSymbol = new SimpleLineSymbol(Color.BLUE, 4);
int addedGraphicId = someGraphicsLayer.addGraphic(new Graphic(pLine, lineSymbol));
Log.d("Class/activity name for logging", "Graphic added id=" + addedGraphicId);
}
catch (Exception ex)
{
// log exception ex.getMessage()
}
... View more
01-19-2012
10:01 PM
|
0
|
0
|
924
|
|
POST
|
May be due to the fact that my English is weak, you do not understand the irony in the question about layers. Behold it, I hope you understand, that you can not correctly display the data from different coordinate systems simultaneously, without using the projection. Yes, I want you to show me an example that refutes it. Working example (live). I am glad that my answer was helpful.
... View more
01-19-2012
09:38 PM
|
0
|
0
|
640
|
|
POST
|
Stephen, Spatial reference and adding layer to map Layers in the same map view might come with different spatial references by default. It is important to render all the layers with the same spatial reference. MapView takes the first added layer's spatial reference as its spatial reference. If you configure a map layout file, the topmost layer inside the map view would be the map's spatial reference. You need to project your geometry to your map spatial reference. P.S. I can not imagine, really. If you have a link to a map containing two or more layers, where each layer has its own coordinate system different from the other layers, then be kind enough to let me see it.
... View more
01-18-2012
10:46 PM
|
0
|
0
|
640
|
|
POST
|
mggl, What API do you use? :confused: You can access the ArcGIS API for Android reference. distance(Geometry geometry1, Geometry geometry2, SpatialReference spatialReference) calculateArea2D() calculateLength2D()
... View more
01-18-2012
09:00 AM
|
0
|
0
|
1227
|
|
POST
|
It all depends on experience. Experience can not be downloaded and compiled. Experience comes when you write the code yourself when you read the documentation. First time opening "Flex Viewer" it seemes to me a heap of code. A year later, it seems to me too simple, easy extendable. One of ESRI requirements for developers is: Good knowledge of Adobe Flex SDK and preferable experience with Flex modules When students come to us to practice and ask where to start, then I advise them to compile and run the examples provided by ESRI development team, and then advise them to work with "Flex Viewer". It takes two weeks and students can create their own widgets, can extend the interface and business logic. IMHO - all depends on developer experience.
... View more
01-18-2012
01:19 AM
|
0
|
0
|
828
|
|
POST
|
mggl (sorry your name is not readable "?lker"), seems like you need to refresh graphics layer, after graphics is added: graphicsLayer.postInvalidate(); How Android Draws postInvalidate()
... View more
01-17-2012
11:55 PM
|
0
|
0
|
688
|
|
POST
|
Daniel, may be this code helps you:
/**
* Sample for Daniel
*/
package ee.alphagis
{
import com.esri.ags.FeatureSet;
import com.esri.ags.Graphic;
import com.esri.ags.geometry.Geometry;
import com.esri.ags.geometry.MapPoint;
public class Entity
{
private var _aaa:String;
private var _bbb:String;
private var _point:MapPoint;
public function get aaa():String
{
return _aaa;
}
public function get bbb():String
{
return _bbb;
}
public function get point():MapPoint
{
return _point;
}
public function Entity(a:String = null, b:String = null, g:MapPoint = null)
{
_aaa = a;
_bbb = b;
_point = g;
}
/**
* @return string in JSON format
*/
public function convertToJson():String
{
var attr:Object = new Object();
attr.a = _aaa;
attr.b = _bbb;
var gr:Graphic = new Graphic(_point, null, attr);
// we need to create FeatureSet for Json converting
var grArray:Array = new Array();
grArray.push(gr);
var fs:FeatureSet = new FeatureSet(grArray);
fs.geometryType = Geometry.MAPPOINT;
return fs.toJSON();
}
/**
* Convert first feature in feature set to Entity
* @param json is string in JSON format, json describes FeatureSet
* @retun Entity
*/
public static function entityFromJson(json:String):Entity
{
// Note the json describes FeatureSet not Graphic
// Look and find in convertToJson() how to create FeatureSet or use API help
if (json != null)
{
var fs:FeatureSet = FeatureSet.fromJSON(json);
if (fs != null)
{
// get array of graphics from feature set
var arr:Array = fs.features as Array;
if (arr != null && arr.length > 0)
{
// get graphic from array
var gr:Graphic = arr[0] as Graphic;
if (gr != null)
{
var gValue:MapPoint = gr.geometry as MapPoint;
var aValue:String;
var bValue:String;
var attr:Object = gr.attributes;
if (attr != null)
{
// get attributes from your graphic
if (attr.hasOwnProperty("a"))
{
aValue = attr["a"].toString();
}
if (attr.hasOwnProperty("b"))
{
bValue = attr["b"].toString();
}
}
return new Entity(aValue, bValue, gValue);
}
}
}
}
return null;
}
}
}
... View more
01-17-2012
11:31 PM
|
0
|
0
|
342
|
|
POST
|
Brad, yes you can reuse: save instance state and restore it as u need. To save activity state use onSaveInstanceState(). To restore activity state use onRestoreInstanceState().
... View more
01-17-2012
10:30 PM
|
0
|
0
|
504
|
|
POST
|
This is second post about it. First was here. 1 - I think offline adding is not a question. Just save created features on internal or external storage (in text file - JSON, xml, CSV or any other format you can read and write with JAVA code). 2 - If feature must be deleted offline, you must know (offline) anything about this feature: some unique attributes (OBJECTID or globalId or ... any other unique attribute value), if you know it make the same steps as adding offline. 3 - Editing offline means, what you know (offline) all editable attributes, if you know it make the same steps as adding offline. 4 - If device is connected to internet - synchronize data: read saved addings, deletes and edits - convert to JSON - send to server. Listen server response - edit conflicts. ... Last person, who send edits to server wins.
... View more
01-17-2012
10:27 AM
|
0
|
0
|
297
|
|
POST
|
AndyP100, 1 Edit widget in ArcGIS Flex Viewer 2.5 is customizable. Widget configuration file has <addfeatures> tag, where you can set new features creation permition. Widget configuration file has <deletefeatures> tag, where you can set features deleting permition. You can extend it adding query by attribute ( use forum search to find topics about it ). Set your query result as selected feature for editor.attributeInspector. 2 New widget creation is documented here. Create widget -> add it as Flex module in application properties -> describe widget in config.xml file -> put UI in <WidgetTemplate> tag of created widget.
... View more
01-17-2012
09:19 AM
|
0
|
0
|
1295
|
|
POST
|
http://msdn.microsoft.com/en-us/library/ff428642.aspx - it is documented in API reference
... View more
01-16-2012
01:31 AM
|
0
|
0
|
2027
|
|
POST
|
Gennady, may be this code is not better solution but it works without JS. 1 - We just added MouseWheel.as in to workspace as it is. 2 - in FlexViewer -> ViewerContainer.mxml added: // inside ViewerContainer.mxml <Script> tag
/**
* Listen creation complete handler
*/
private function init():
{
//...
initWheelEvents();
}
/**
* Init mouse wheel events listeners
*/
protected function initWheelEvents():void
{
if (mapManager && mapManager.map)
{
mapManager.map.addEventListener(MouseEvent.ROLL_OVER, mouseWheelOver);
mapManager.map.addEventListener(MouseEvent.ROLL_OUT, mouseWheelOut);
}
}
/**
* mouse wheel out handler
*/
protected function mouseWheelOut(event:MouseEvent):void
{
MouseWheel.release();
}
/**
* mouse wheel over handler
*/
protected function mouseWheelOver(event:MouseEvent):void
{
MouseWheel.capture();
}
... View more
01-03-2012
10:02 PM
|
0
|
0
|
6814
|
|
POST
|
FlashDevelop -> Getting Started - > Action Script 3 ->Choosing a compiler Just read the help for the tools, plugins, developer kits that you use.
... View more
12-20-2011
09:58 PM
|
0
|
0
|
457
|
|
POST
|
http://flex.org/get-started/ http://help.adobe.com/en_US/flex/using/WS6aa5ec234ff3f2851d96da0f125b7687eb5-8000.html http://help.arcgis.com/en/webapi/flex/samples/01nq/01nq0000006m000000.htm http://help.arcgis.com/en/webapi/flex/help/017p/017p0000001q000000.htm
... View more
12-20-2011
12:55 AM
|
0
|
0
|
457
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 12-03-2017 11:25 PM | |
| 1 | 10-06-2016 11:49 PM | |
| 2 | 06-07-2012 01:38 AM | |
| 1 | 06-03-2012 09:42 PM |
| Online Status |
Offline
|
| Date Last Visited |
11-11-2020
02:23 AM
|