Select to view content in your preferred language

Graphic layer is not loading in our mapserver

844
2
Jump to solution
09-15-2012 11:02 PM
JulieBiju
Deactivated User
Hello...Advance thanks...Please help me to solve the issue specified below

I am adding graphics on my map.It is working fine with the following URL.

<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />

Last week we  installed arcgis server 10.1 in my server ,and everything is working fine with our own map data.But only the graphics is not showing.If I change the Url I specifeid above then the graphics showing perfect.Can anybdy help me where is the problem?See my code below...

<esri:Map Extent="-120, 20, -100, 40"  Grid.Row="3" Name="MyMap"  Visibility="Visible" Background="Transparent" Margin="2,0" BorderThickness="1" BorderBrush="{StaticResource TitleBarGradient}">           <!--<esri:ArcGISTiledMapServiceLayer ID="StreetMapLayer" Url="http://server.arcgisonline.com/ArcGIS/rest/services/ESRI_StreetMap_World_2D/MapServer" />-->             <esri:ArcGISDynamicMapServiceLayer ID="StreetMapLayer" Url="http://www.test.com:8000/arcgis/rest/services/pp/om/MapServer" />           <esri:GraphicsLayer ID="MyGraphicsLayer" />         </esri:Map>         <esri:MapProgressBar x:Name="MyProgressBar" Grid.Row="3"    Map="{Binding ElementName=MyMap}"    HorizontalAlignment="Center" VerticalAlignment="Bottom"    Width="200" Height="36"    Margin="25"  />         <esri:InfoWindow x:Name="MyInfoWindow"                          Padding="2"                          CornerRadius="20"                           Background="LightSalmon"                          Map="{Binding ElementName=MyMap}"                           ContentTemplate="{StaticResource MyGrLayerInfoWindowTemplate}"                          />


   <esri:SimpleMarkerSymbol x:Key="RedMarkerSymbol" Color="Red" Size="12" Style="Circle" />             <esri:SimpleMarkerSymbol x:Key="BlackMarkerSymbol" Color="Black" Size="14" Style="Diamond" />             <esri:PictureMarkerSymbol x:Key="GlobePictureSymbol_Blue" OffsetX="8" OffsetY="8"                  Source="/ESRI-V-10-SIL4;component/Images/sphere-blue-dark-16x16.png" />             <esri:PictureMarkerSymbol x:Key="GlobePictureSymbol_Green" OffsetX="8" OffsetY="8"                  Source="/ESRI-V-10-SIL4;component/Images/sphere-green-dark-16x16.png" />             <esri:PictureMarkerSymbol x:Key="GlobePictureSymbol_Red" OffsetX="8" OffsetY="8"                  Source="/ESRI-V-10-SIL4;component/Images/sphere-red-dark-16x16.png" />             <esri:PictureMarkerSymbol x:Key="GlobePictureSymbol_Black" OffsetX="8" OffsetY="8"                  Source="/ESRI-V-10-SIL4;component/Images/sphere-Black-dark-16x16.png" />             <esri:PictureMarkerSymbol x:Key="GlobePictureSymbol_Gray" OffsetX="8" OffsetY="8"                  Source="/ESRI-V-10-SIL4;component/Images/sphere-Gray-dark-16x16.png" />             <esri:SimpleLineSymbol x:Key="DefaultLineSymbol" Color="Green" Style="DashDot" Width="4" />             <esri:SimpleFillSymbol x:Key="DefaultFillSymbol" Fill="Green" BorderBrush="Blue"                  BorderThickness="3" />         </Grid.Resources>


  If EventId = 253 Then                 colourstyle = "GlobePictureSymbol_Blue"             ElseIf EventId = 110 Then                 colourstyle = "GlobePictureSymbol_Green"             ElseIf EventId = 108 Then 'Added for fix time report for new device                 colourstyle = "GlobePictureSymbol_Green"             ElseIf EventId = 101 Then                 colourstyle = "GlobePictureSymbol_Red"             ElseIf EventId = 142 Then                 colourstyle = "GlobePictureSymbol_Black"             ElseIf EventId = 254 Then                 colourstyle = "GlobePictureSymbol_Gray"             Else                 colourstyle = "GlobePictureSymbol_Black"             End If              Dim graphic As New Graphic() With                 {                     .Geometry = New MapPoint(Convert.ToDouble(gpsNMEASentence(4)), Convert.ToDouble(gpsNMEASentence(2))),                     .Symbol = TryCast(LayoutRoot.Resources(colourstyle), Symbol)                 }
0 Kudos
1 Solution

Accepted Solutions
DominiqueBroux
Esri Frequent Contributor
Likely a map spatial reference issue.

If you map is not using geographical coordinates, the graphics have to be projected on the fly. To do that, you have to set the ProjectionService of your graphicsLayer.

Another option is to force your map in geographical coordinates by setting a geographical extent (WKID=4326) to your map.

View solution in original post

0 Kudos
2 Replies
JulieBiju
Deactivated User
Can anybdy help meee plssss
0 Kudos
DominiqueBroux
Esri Frequent Contributor
Likely a map spatial reference issue.

If you map is not using geographical coordinates, the graphics have to be projected on the fly. To do that, you have to set the ProjectionService of your graphicsLayer.

Another option is to force your map in geographical coordinates by setting a geographical extent (WKID=4326) to your map.
0 Kudos