Hi,
I'm trying to build Silverlight Application that highlights features on the base map when the user clicks on the map. The lat and long value of the clicked position is send to web service,. The web service process the data, creates a new InMemoryFeatureLayer. This InMemoryFeatureLayer is added to the ServerLayerOverlay within the web service.The web service is supposed to send this ServerLayerOverlay to the client so that it is added to the map as a new layer. However, I get an error message as:
"The server did not provide a meaningful reply; this might be caused by a contract mismatch, a premature session shutdown or an internal server error."
My question is:
1) How can I get The ShapeFile Feature layer from the server at the client side. Is it possible at client side to get all the layers from the ServerLayerOverlay that is rendered on the server side?
2) How do I pass the paramerters to the server side to create FleeBooleanStyle dynamically. The sample below uses static value string expression = "(ToInt32(POP_CNTRY)>10000000) AND (ToChar(LANDLOCKED)='Y')". I want to be able to get the users choice to filter the ShapeFileFeatureLayer.
// Native Server 5
// Highlight the countries that are land locked and have a population greater than 10 million
string expression = "(ToInt32(POP_CNTRY)>10000000) AND (ToChar(LANDLOCKED)='Y')";
FleeBooleanStyle landLockedCountryStyle = new FleeBooleanStyle(expression);
// You can access the static methods on these types. We use this
// to access the Convert.Toxxx methods to convert variable types
landLockedCountryStyle.StaticTypes.Add(typeof(System.Convert));
// The math class might be handy to include but in this sample we do not use it
//landLockedCountryStyle.StaticTypes.Add(typeof(System.Math));
landLockedCountryStyle.ColumnVariables.Add("POP_CNTRY");
landLockedCountryStyle.ColumnVariables.Add("LANDLOCKED");
landLockedCountryStyle.CustomTrueStyles.Add(new AreaStyle(new GeoPen(GeoColor.SimpleColors.Green, 2), new GeoSolidBrush(GeoColor.FromArgb(100, GeoColor.SimpleColors.Green))));
landLockedCountryStyle.CustomFalseStyles.Add(AreaStyles.CreateSimpleAreaStyle(GeoColor.SimpleColors.Transparent, GeoColor.FromArgb(100, GeoColor.SimpleColors.Green)));
ShapeFileFeatureLayer fleeBooleanWorldLayer = new ShapeFileFeatureLayer(MapPath("~/app_data/cntry02.shp"), ShapeFileReadWriteMode.ReadOnly);
fleeBooleanWorldLayer.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(landLockedCountryStyle);
fleeBooleanWorldLayer.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
ServerLayerOverlay fleeBooleanOverlay = new ServerLayerOverlay("NativeServerWithFleeBoolean");
fleeBooleanOverlay.Layers.Add(fleeBooleanWorldLayer);
SilverlightMapConnector1.ServerLayerOverlays.Add(fleeBooleanOverlay);
I have attached my mainpage.xaml,mainPage.xaml.cs, GetGeoDataService.svc, GetGeoDataService.svc.cs and Default.aspx and default.aspx.cs in the attachment . Can someone please point me in the right direction?
Thanks!
Prava Kafle