Select to view content in your preferred language

problem using arcgisonline basemaps

1041
11
02-13-2012 07:31 AM
MichaelZierten
New Contributor
I'm trying to use the arcgis online basemaps (http://server.asrcgisonline.com/ArcGIS/rest/services/) as basemaps in my application. My feature data is all in Web Mercator Auxiliary Sphere (DynamicMapServiceLayer). The feature classes will show and project properly, but the base layers don't appear. If I remove the feature classes, the base layers show up in GCS, without any projection (the map is squashed down).  I've defined the spatial reference (wkid=102100), but it still won't work.
               
                <esri:Extent id="NVExtent"   
      xmin="-13856000"
      ymin="4243000"
      xmax="-12291000"
      ymax="5182000" >
    <esri:SpatialReference wkid="102100" />
  </esri:Extent>

Note: I've used all my layers in ArcGIS Viewer for Flex, with the ESRI base layers, and everything works fine. ???
Tags (2)
0 Kudos
11 Replies
RobertScheitlin__GISP
MVP Emeritus
Michael,

   Can you post a very abbreviated version of an app that just has the basemaps and your layers, so I can see how you are adding them to the map.
0 Kudos
MichaelZierten
New Contributor
<fx:Declarations>
<esri:Extent id="NVExtent"   
    xmin="-13856000"
    ymin="4243000"
    xmax="-12291000"
    ymax="5182000" >
  <esri:SpatialReference wkid="102100" />
</esri:Extent>
</fx:Declarations>

<esri:Map id="ndwrMap" scale="4617150"
    logoVisible="false"
    left="310" top="75" right="5" bottom="75" extent="{NVExtent}" >

<esri:ArcGISDynamicMapServiceLayer url="http://ndwr-gis/ArcGIS/rest/services/stateMask/MapServer"
         id="stateMask" name="State_Mask"
         alpha="0.5" />
 
<esri:ArcGISTiledMapServiceLayer id="roads" url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer"
           visible="{bb.selectedIndex == 0}"/>
</esri:Map>
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michael,

   OK you issue is that the tiled map service has to be the very first one added to the map (so it can get the LODs from that layer).

Don't forget to click the Mark as answer check and to click the top arrow (promote) as shown below:
0 Kudos
MichaelZierten
New Contributor
Now the  map is zoomed way in, 1:100.  It's almost like my extents aren't correct.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michael,

   Try using this link to determine your correct inital extent numbers than:

http://help.arcgis.com/en/webapps/flexviewer/extenthelper/flexviewer_extenthelper.html
0 Kudos
MichaelZierten
New Contributor
Those are the correct extents for Nevada according to the extents tool. These extents work fine with my feature classes, just not with the ESRI basemaps. For some reason I can't get the ESRI maps into the correct projection.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Michael,

   I found that you were using the OLD esri basemap that was in WGS and not web mercator!

<?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">
    <fx:Declarations>
        <esri:Extent id="NVExtent"
                     xmin="-13856000"
                     ymin="4243000"
                     xmax="-12291000"
                     ymax="5182000" >
            <esri:SpatialReference wkid="102100" />
        </esri:Extent>
    </fx:Declarations>
    
    <esri:Map id="ndwrMap" extent="{NVExtent}"
              logoVisible="false"
              left="310" top="75" right="5" bottom="75" >
        
        <esri:ArcGISTiledMapServiceLayer id="roads"
                                         url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"
                                         visible="true"/>
        <esri:ArcGISDynamicMapServiceLayer url="http://ndwr-gis/ArcGIS/rest/services/stateMask/MapServer"
                                                   id="stateMask" name="State_Mask"
                                                   alpha="0.5" />
    </esri:Map> 
</s:Application>
0 Kudos
MichaelZierten
New Contributor
This is what the properties for that service say:

Coordinate System:
Name: WGS_1984_Web_Mercator_Auxiliary_Sphere
Projection: Mercator_Auxiliary_Sphere

Isn't this web mercator?
0 Kudos
MichaelZierten
New Contributor
I'm an id10t...

I was looking a World_Street_Map, which is the correct projection, but my map had ESRI_World_Street_Map, which is WGS 84. 

Thanks Robert. I've marked this as the answer.
0 Kudos