ESRI with FLEX basic stuff

3551
4
Jump to solution
08-28-2014 03:28 PM
RafaelGarcía_Ocampo
New Contributor II

Hello, I'm quite new at this, and I'm trying some of the examples of the page FeatureLayer tooltips—ArcGIS API for Flex | ArcGIS for Developers

most of them I made them work, but I have some issues and questions.

First at all, do you know how can I add points from a database query? I mean, I make a query like with a drop down list or with a data grid, but this information I want that this map renders the coordinates from the data base, does anyone have any example? I was reading that I need to make my map layer for this, and then call it in flex, but I still can't find how to do this.

And the next one, there is one map layer that I can't see it in Flex, "Recent Hurricane"Captura de pantalla 2014-08-28 a la(s) 17.24.06.png

I can watch it in ArcGIS Online, but when I call it from flex, doesn't show anything... any ideas?

Is the LAST OPTION, Here is my code...

<esri:Map id="myMap" width="1013" height="467" extent="{new Extent(-8658000, 5703000, -8655000, 5705000, new SpatialReference(102100))}" load="drawTool.activate(DrawTool.POLYGON)">

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer" visible="{bb.selectedIndex == 0}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServe..." visible="{bb.selectedIndex == 0}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer" visible="{bb.selectedIndex == 1}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer" visible="{bb.selectedIndex == 2}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://server.arcgisonline.com/ArcGIS/rest/services/Ocean_Basemap/MapServer" visible="{bb.selectedIndex == 3}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://server.arcgisonline.com/ArcGIS/rest/services/NatGeo_World_Map/MapServer" visible="{bb.selectedIndex == 4}"/>

  <esri:ArcGISTiledMapServiceLayer show="layerShowHandler(event)" url="http://livefeeds.arcgis.com/arcgis/rest/services/LiveFeeds/Hurricane_Recent/MapServer" visible="{bb.selectedIndex == 5}"/>

  <esri:GraphicsLayer id="myGraphicsLayer" symbol="{mySFS}"/>

  </esri:Map>

  <s:ButtonBar id="bb" right="5" top="5" requireSelection="true">

  <s:dataProvider>

  <s:ArrayList>

  <fx:String>Satélite división política</fx:String>

  <fx:String>Topografía</fx:String>

  <fx:String>Calles</fx:String>

  <fx:String>Óceanos</fx:String>

  <fx:String>National Geographic</fx:String>

  <fx:String>Huracanes</fx:String>

  </s:ArrayList>

  </s:dataProvider>

  </s:ButtonBar>

Have a great day...

0 Kudos
1 Solution

Accepted Solutions
RobertScheitlin__GISP
MVP Emeritus

Rafael,

   If you have a database that has XY coordinates then you need to create a XY Event layer in ArcMap (you need to refer to ArcGIS Desktop help for this) once you have your data showing in ArcMap then you can publish this map as a map service to ArcGIS Server or your AGOL organizational account. After that you will have a REST Service url that you can use like all the other URLs you are referencing in your app.

To use the Hurricane_Recent live feed in your app use this url: http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/Hurricane_Recent/MapServer

View solution in original post

4 Replies
RobertScheitlin__GISP
MVP Emeritus

Rafael,

   If you have a database that has XY coordinates then you need to create a XY Event layer in ArcMap (you need to refer to ArcGIS Desktop help for this) once you have your data showing in ArcMap then you can publish this map as a map service to ArcGIS Server or your AGOL organizational account. After that you will have a REST Service url that you can use like all the other URLs you are referencing in your app.

To use the Hurricane_Recent live feed in your app use this url: http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/Hurricane_Recent/MapServer

RafaelGarcía_Ocampo
New Contributor II

Thank you very much Robert Scheitlin, GISP!

I will check ArcGIS Desktop help, I would love to mark this as correct answer, but  I still can't see the hurricane layer, do you think it has to be, because I'm in a VPN ? I can´t try it without VPN cause to enter my work database I need to be logged in the vpn, any other ideas?

0 Kudos
RobertScheitlin__GISP
MVP Emeritus

Rafael,

  Sorry I did not notice that you were trying to load the layer as a ArcGISTiledMapServiceLayer. This map service is not cached so you have to use ArcGISDynamicMapServiceLayer.

<esri:ArcGISDynamicMapServiceLayer show="layerShowHandler(event)" url="http://tmservices1.esri.com/arcgis/rest/services/LiveFeeds/Hurricane_Recent/MapServer" visible="{bb.selectedIndex == 5}"/>

RafaelGarcía_Ocampo
New Contributor II

Awesome!

Thank you very much! Have a nice day!

0 Kudos