|
POST
|
Is the problem when the function is being called? It should work as you've written it, but the function will only be called once unless the function takes a bindable argument, in which case it'd be called whenever the binding on the argument is triggered.
... View more
09-28-2010
02:19 PM
|
0
|
0
|
438
|
|
POST
|
The Viewer doesn't support wms services yet. (The API does as of 2.1.) You can try using their ArcGIS REST service here instead: http://services.azgs.az.gov/arcgis/rest/services/OneGeology/AZGS_Arizona_Geology/MapServer You'll need to use a proxy though since they don't have a cross domain policy file at: http://services.azgs.az.gov/crossdomain.xml
... View more
09-28-2010
12:58 PM
|
0
|
0
|
2635
|
|
POST
|
I'm not familiar with the 1.3 code, but I'd start by using a tool like HttpFox to carefully compare the REST requests.
... View more
09-28-2010
11:55 AM
|
0
|
0
|
552
|
|
POST
|
Here's a modification of the BufferSample at: http://help.arcgis.com/en/webapi/flex/samples/index.html?sample=BufferSample I've fixed the myGeometryService url and changed the base layer to a 4326 service. An example of the requests it sends is: http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer/buffer?unionResults=false&f=json&bufferSR=102100&geometries=%7B%22geometryType%22%3A%22esriGeometryPoint%22%2C%22geometries%22%3A%5B%7B%22x%22%3A%2D114%2E51800371679786%2C%22y%22%3A33%2E55105676332971%7D%5D%7D&unit=9036&distances=50%2C100&inSR=4326 <?xml version="1.0" encoding="utf-8"?>
<s:Application xmlns:fx="http://ns.adobe.com/mxml/2009"
xmlns:s="library://ns.adobe.com/flex/spark"
xmlns:mx="library://ns.adobe.com/flex/mx"
xmlns:esri="http://www.esri.com/2008/ags"
pageTitle="Buffer using the Geometry Service">
<!--
This sample creates buffers around the center of the map. This example just draws the buffers,
but the buffers could also be used to perform a task such as returning a list of addresses of
people who live within the buffered area.
-->
<s:controlBarLayout>
<s:HorizontalLayout horizontalAlign="center"
paddingBottom="7"
paddingTop="7"/>
</s:controlBarLayout>
<s:controlBarContent>
<s:Button click="bufferCenterOfMap()" label="Buffer Center Of Map"/>
</s:controlBarContent>
<fx:Declarations>
<esri:SimpleFillSymbol id="sfs" color="0xFF0000">
<esri:SimpleLineSymbol color="0x000000"/>
</esri:SimpleFillSymbol>
<esri:GeometryService id="myGeometryService" url="http://sampleserver3.arcgisonline.com/ArcGIS/rest/services/Geometry/GeometryServer"/>
</fx:Declarations>
<fx:Script>
<![CDATA[
import com.esri.ags.Graphic;
import com.esri.ags.SpatialReference;
import com.esri.ags.events.GeometryServiceEvent;
import com.esri.ags.geometry.MapPoint;
import com.esri.ags.geometry.Polygon;
import com.esri.ags.tasks.supportClasses.BufferParameters;
private function bufferCenterOfMap():void
{
var myMapCenterPoint:MapPoint = MapPoint(myMap.extent.center);
var bufferParameters:BufferParameters = new BufferParameters();
// Note: As of version 2.0, the GeometryService input is geometries (instead of graphics).
bufferParameters.geometries = [ myMapCenterPoint ];
bufferParameters.distances = [ 50, 100 ];
// Note: As of version 2.0, the buffer constants have been moved to GeometryService.
bufferParameters.unit = GeometryService.UNIT_KILOMETER;
bufferParameters.bufferSpatialReference = new SpatialReference(102100);
myGeometryService.addEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler);
myGeometryService.buffer(bufferParameters);
function bufferCompleteHandler(event:GeometryServiceEvent):void
{
myGeometryService.removeEventListener(GeometryServiceEvent.BUFFER_COMPLETE, bufferCompleteHandler);
// Note: As of version 2.0, GeometryService returns geometries (instead of graphics)
for each (var geometry:Polygon in event.result)
{
var graphic:Graphic = new Graphic();
graphic.geometry = geometry;
graphic.symbol = sfs;
graphicsLayer.add(graphic);
}
}
}
]]>
</fx:Script>
<esri:Map id="myMap"
crosshairVisible="true"
level="2">
<esri:ArcGISTiledMapServiceLayer url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"/>
<esri:GraphicsLayer id="graphicsLayer"/>
</esri:Map>
</s:Application>
... View more
09-28-2010
11:47 AM
|
0
|
0
|
1054
|
|
POST
|
Yes, that's defined by the inSR REST parameter. The Flex API's BufferParameters doesn't have a property for this since the GeometryService gets it automatically from the first geometry in the geometries Array. Can you use a tool like HttpFox to verify if the inSR is being sent correctly in the REST request?
... View more
09-28-2010
10:59 AM
|
0
|
0
|
1054
|
|
POST
|
When you click on a result in the table, is it not panning and zooming the map to that feature? That's what I'm seeing in the sample.
... View more
09-28-2010
10:55 AM
|
0
|
0
|
552
|
|
POST
|
Not in onDemand mode since it only queries for features within the current extent so there's no way to know what the extent is of all the features matching the new definition expression. I'd stick with snapshot mode and then you can zoom to the extent of the features in the graphicProvider after updateEnd.
... View more
09-28-2010
10:43 AM
|
0
|
0
|
1980
|
|
POST
|
Did you try to change the width and height in SplashWidget.xml? The default is: <width>375</width> <height>375</height>
... View more
09-28-2010
09:53 AM
|
0
|
0
|
1078
|
|
POST
|
Try setting bufferSpatialReference to 102100 if you want to use Web Mercator and the outSpatialReference to 4326. Note from: http://sampleserver3.arcgisonline.com/ArcGIS/SDK/REST/buffer.html Note that when the bufferSR is GCS: Points and Multipoints: if unit is linear such as feet or meters, geodesic buffering is performed. Polylines and Polygons: unit must be angular such as decimal degrees for buffering to be performed.
... View more
09-28-2010
09:48 AM
|
0
|
0
|
1054
|
|
POST
|
Have you tried setting the bufferSpatialReference on your BufferParameters? http://help.arcgis.com/en/webapi/flex/apiref/com/esri/ags/tasks/supportClasses/BufferParameters.html#bufferSpatialReference
... View more
09-27-2010
02:15 PM
|
0
|
0
|
1054
|
|
POST
|
The spatial reference of NGS_Topo_US_2D is 4326 so you'll need to update the initial extent to also be in 4326 values. Also make sure that all your other tiled layers are also in 4326 since they can not be re-projected.
... View more
09-27-2010
01:56 PM
|
0
|
0
|
825
|
|
POST
|
Yes, the initial extent should be in the same spatial reference as the first base layer.
... View more
09-27-2010
01:11 PM
|
0
|
0
|
1379
|
| Title | Kudos | Posted |
|---|---|---|
| 1 | 03-06-2017 01:13 PM | |
| 2 | 03-06-2017 02:12 PM | |
| 1 | 06-22-2010 12:01 PM | |
| 1 | 08-06-2012 09:29 AM |
| Online Status |
Offline
|
| Date Last Visited |
04-15-2025
04:18 PM
|