Select to view content in your preferred language

Map  is not displayed when spatial Reference is explicitly specified.

1334
6
04-05-2010 11:05 PM
Shimonchh
Emerging Contributor
I am using Flex Sample Viewer 1.3.

When I write following my map is displayed but Draw Widget doesn't work . Project Complete Handler event is not called.

var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]));



but when I write
 
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]),new SpatialReference(4326));

DrawWidget works but map is not displayed.
Please suggest me something to solve this problem.
Tags (2)
0 Kudos
6 Replies
RobertScheitlin__GISP
MVP Emeritus
Shimon31,

    I have to admit you have me a little confused here. In the SFV 1.3 this line of code is there by default
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]));
and both the map displays and the draw widget works...

When you say that you set the code to
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]),new SpatialReference(4326));

and the map does not display but the draw widget work, what is the spatial reference of you map services that are in the map? are you using the default OLD basemaps or the newer ones that are in WKID 102100?
0 Kudos
Shimonchh
Emerging Contributor
thanks for your reply sir

yae this is the default line

var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]));


but when i draw a line by using draw widget projectCompleteHandler function is not called. and no result is shown

but when i changed this above line of map manager like this

When you say that you set the code to
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]),new SpatialReference(4326));


then draw widget works. it gives lenth of line but map is not displayed . although i can retrieve all values of map like name of layers etc.

spatial reference of my map services is 4326.



Shimon31,

    I have to admit you have me a little confused here. In the SFV 1.3 this line of code is there by default
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]));
and both the map displays and the draw widget works...

When you say that you set the code to
var extent:Extent = new Extent(Number(extArray[0]), Number(extArray[1]), Number(extArray[2]), Number(extArray[3]),new SpatialReference(4326));

and the map does not display but the draw widget work, what is the spatial reference of you map services that are in the map? are you using the default OLD basemaps or the newer ones that are in WKID 102100?
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Shimon31,

    The fact is that the SFV 1.3 works out of the box using basemaps in 4326 (both map display and the draw widget). With the minor exception of dynamic maps that is discussed here in this thread http://forums.esri.com/Thread.asp?c=158&f=2421&t=297291&mc=3#927860.

    If the dynamic maps issue is not your issue than either you have changed some code or your map services are in another projection. It really doesn't matter if your map services are in another projection as long as they are added as they are added to the livemaps or basemaps section of the config.xml with a type value of dynamic.

   What is your map services WKID? Maybe you should post your config.xml.
0 Kudos
Shimonchh
Emerging Contributor
Sir
thank u for ur quick response.

this is the code of my config.xml file.

<?xml version="1.0" ?>
<configuration>
<userinterface>
  <banner>visible</banner>
  <title>ABC</title>
  <subtitle>ABC</subtitle>
  <!--<logo>com/esri/solutions/flexviewer/assets/images/logo.png</logo>-->
  <stylesheet>com/esri/solutions/flexviewer/themes/darkangel/style.swf</stylesheet>
  <menus>
   <menu id="menuMap" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_globe.png">Map</menu>
   <menu id="menuNav" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_nav.png">Navigation</menu>
   <menu id="menuWidgets" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_widget.png">Tools</menu>
   <!--<menu id="menuFeeds" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_servicearea.png">Feeds</menu>
   <menu id="menuHelp" visible="true" icon="com/esri/solutions/flexviewer/assets/images/icons/i_help.png">Help</menu>-->
  </menus>
</userinterface>

<map initialExtent="515168.840244997 676464.495628832 621558.454454999 822760.132171167" fullExtent="515168.840244997 690360.704670001 621558.454454999 808863.923129998" >
<basemaps menu="menuMap">     
   <mapservice label="Akola Map" type="dynamic" visible="true" alpha="1" icon="com/esri/solutions/flexviewer/assets/images/icons/i_highway.png">http://ws13/ArcGIS/rest/services/akola_map/MapServer</mapservice>
           
</basemaps>

       
<livemaps>
  <mapservice label="Akolaaaa" type="dynamic" visible="false" alpha="1">http://ws13/ArcGIS/rest/services/akola_map/MapServer</mapservice>
  </livemaps>
</map>
<navtools>
  <navtool label="Zoom In" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomin.png" menu="menuNav">zoomin</navtool>
  <navtool label="Zoom Out" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomout.png" menu="menuNav">zoomout</navtool>
  <navtool label="Full Extent" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomfull.png" menu="menuNav">zoomfull</navtool>
  <navtool label="Re-center Map" icon="com/esri/solutions/flexviewer/assets/images/icons/i_pan.png" menu="menuNav">pan</navtool>
</navtools>
<widgets>
  <widget label="Table Of Contents" icon="com/esri/solutions/flexviewer/assets/images/icons/i_folder.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/LiveMapsWidget.xml">com/esri/solutions/flexviewer/widgets/LiveMapsWidget.swf</widget>
  <widget label="Overview Map" preload="minimized" icon="com/esri/solutions/flexviewer/assets/images/icons/i_overview.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/OverviewMapWidget.xml">com/esri/solutions/flexviewer/widgets/OverviewMapWidget.swf</widget>
  <widget label="Bookmarks" preload="minimized" icon="com/esri/solutions/flexviewer/assets/images/icons/i_bookmark.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/BookmarkWidget.xml">com/esri/solutions/flexviewer/widgets/BookmarkWidget.swf</widget>
  <widget label="Print" icon="com/esri/solutions/flexviewer/assets/images/icons/i_print.png" menu="menuMap" config="com/esri/solutions/flexviewer/widgets/PrintWidget.xml">com/esri/solutions/flexviewer/widgets/PrintWidget.swf</widget> 
   <widget label="Draw" icon="com/esri/solutions/flexviewer/assets/images/icons/i_draw.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/DrawWidget.xml">com/esri/solutions/flexviewer/widgets/DrawWidget.swf</widget>
   <widget label="Export" icon="com/esri/solutions/flexviewer/assets/images/icons/i_about.png" menu="menuWidgets">com/esri/solutions/flexviewer/widgets/exportMap.swf</widget>
  
    <widget label="Identify" icon="com/esri/solutions/flexviewer/assets/images/icons/i_info.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/IdentifyWidget.xml">com/esri/solutions/flexviewer/widgets/IdentifyWidget.swf</widget>
        <widget label="Show Phc" icon="com/esri/solutions/flexviewer/assets/images/icons/i_info.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/IdentifyWidget.xml">com/esri/solutions/flexviewer/widgets/phcSc.swf</widget> 
     <widget label="Charts" icon="com/esri/solutions/flexviewer/assets/images/icons/i_globe.png" menu="menuWidgets" config="com/esri/solutions/esa/widgets/ChartWidget.xml">com/esri/solutions/esa/widgets/ChartWidget.swf</widget>

    <widget label="Query Builder" icon="com/esri/solutions/flexviewer/assets/images/icons/i_folder.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/QueryBuilderWidget.xml">com/esri/solutions/flexviewer/widgets/QueryBuilderWidget.swf</widget>
  <widget label="Search" icon="com/esri/solutions/flexviewer/assets/images/icons/i_search.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/SearchWidget.xml">com/esri/solutions/flexviewer/widgets/SearchWidget.swf</widget>
   
      
     <widget label="Magnifier Window" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomin.png" menu="menuWidgets" config="">com/esri/solutions/flexviewer/widgets/MagLensWidget.swf</widget>
     <widget label="LayerAnimation" icon="com/esri/solutions/flexviewer/assets/images/icons/i_zoomin.png" menu="menuWidgets" config="com/esri/solutions/flexviewer/widgets/LayerAnimationWidget.xml">com/esri/solutions/flexviewer/widgets/LayerAnimationWidget.swf</widget>
    
</widgets>


  <proxytype>asp</proxytype> <!-- apache|jsp||php -->
</configuration>




And this is my map detail :

Spatial Reference: PROJCS["WGS_1984_Lambert_Conformal_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",500000.0],PARAMETER["Central_Meridian",76.5],PARAMETER["Standard_Parallel_1",16.16666666666667],PARAMETER["Standard_Parallel_2",20.83333333333333],PARAMETER["Latitude_Of_Origin",18.50542944444445],UNIT["Meter",1.0]]

Single Fused Map Cache: false

Intial Extent:

XMin: 515168.840244997
YMin: 676464.495628832
XMax: 621558.454454999
YMax: 822760.132171167
Spatial Reference: PROJCS["WGS_1984_Lambert_Conformal_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",500000.0],PARAMETER["Central_Meridian",76.5],PARAMETER["Standard_Parallel_1",16.16666666666667],PARAMETER["Standard_Parallel_2",20.83333333333333],PARAMETER["Latitude_Of_Origin",18.50542944444445],UNIT["Meter",1.0]]

Full Extent:

XMin: 515168.840244997
YMin: 690360.704670001
XMax: 621558.454454999
YMax: 808863.923129998
Spatial Reference: PROJCS["WGS_1984_Lambert_Conformal_Conic",GEOGCS["GCS_WGS_1984",DATUM["D_WGS_1984",SPHEROID["WGS_1984",6378137.0,298.257223563]],PRIMEM["Greenwich",0.0],UNIT["Degree",0.0174532925199433]],PROJECTION["Lambert_Conformal_Conic"],PARAMETER["False_Easting",500000.0],PARAMETER["False_Northing",500000.0],PARAMETER["Central_Meridian",76.5],PARAMETER["Standard_Parallel_1",16.16666666666667],PARAMETER["Standard_Parallel_2",20.83333333333333],PARAMETER["Latitude_Of_Origin",18.50542944444445],UNIT["Meter",1.0]]

Units: esriMeters


pls give any suggestion...

thanks



Shimon31,

    The fact is that the SFV 1.3 works out of the box using basemaps in 4326 (both map display and the draw widget). With the minor exception of dynamic maps that is discussed here in this thread http://forums.esri.com/Thread.asp?c=158&f=2421&t=297291&mc=3#927860.

    If the dynamic maps issue is not your issue than either you have changed some code or your map services are in another projection. It really doesn't matter if your map services are in another projection as long as they are added as they are added to the livemaps or basemaps section of the config.xml with a type value of dynamic.

   What is your map services WKID? Maybe you should post your config.xml.
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
shimon31,

    WGS 1984 Lambert Conformal Conic is not the same as WGS 1984.

Here is a quote from the Spatial Reference Class of the AGS Flex API.

Each projected and geographic coordinate system is defined by both a well-known ID (WKID) or a definition string (WKT). The ArcGIS API for Flex (and the underlying ArcGIS Server REST API) only supports well-known IDs (not definition strings).


Your map service does not have a Well Known ID (WKID), hence the issues you are having. Only suggestion I have for you is to re-project your data into a WKID.
0 Kudos
Shimonchh
Emerging Contributor
Thank u sir for ur suggetions
i have changed projection of the map and now all functions are working
0 Kudos