Hi Khalil,
All seems ok now wrt the earlier query [map working fine in an update panel] but I do have another issue that may be related.
I have 3 groups of items to display in a part of our application that managed vehicles
Layer 1. Customer Address [mostly static]
Layer 2. Location of Customer Assets within the Customer Addres. [mostly static]
Layer 3. Location of Vehicle [and optionally the historical location of the selected vehicle]
All works fine with markers for all 3 layers displaying fine.
Location of the truck is manually fired by the click event of a button on the web page at the minute while I'm developing the application.
Layers 1 and 2 with the loaded with the relevant markers at page load.
When I get the location of the truck it works fine.
But when I add a new FeatureSourceColumn i get the following error
Microsoft JScript compilation error: Syntax error
In debug it stops at this point
OpenLayers.Ajax.Responders.dispatch('on'+state,this,response)
Development machine = XP SP3 using Visual Studio 2010 and IE7
WebEdition is 4.0.40.0
MapSuiteCore.dll is 4.0.40.0
Just to be clear though.
CreateVehicleLayer() below is run on page load but the error does not occur until UpdateMapButton_Click is run.
I have cut out any unnecessary code in UpdateMapButton_Click even to the point where I'm not adding any column values
Here is a snap shot of the code. [Its based on your samples]
private void CreateVehicleLayer()
{
InMemoryMarkerOverlay vehicleOverlay = new InMemoryMarkerOverlay("Vehicles");
vehicleOverlay.FeatureSource.Open();
vehicleOverlay.Columns.Add(new FeatureSourceColumn("Status", "string", 50));
//vehicleOverlay.Columns.Add(new FeatureSourceColumn("Status"));
vehicleOverlay.FeatureSource.Close();
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.ContentHtml = "Truck A";
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.HasCloseButton = true;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Width = 100;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.Height = 30;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BackgroundColor = GeoColor.StandardColors.LightBlue;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderColor = GeoColor.StandardColors.Black;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.Popup.BorderWidth = 1;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageOffsetX = -10.5f;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageOffsetY = -25f;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageWidth = 21;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage.ImageHeight = 25;
vehicleOverlay.ZoomLevelSet.ZoomLevel01.DefaultMarkerStyle.WebImage = new WebImage("../i/RubbishTruck.jpg", 21, 25);
// Make it available all over the zoomlevels.
vehicleOverlay.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20;
vehicleOverlay.IsVisibleInOverlaySwitcher = true;
this.Map1.CustomOverlays.Add(vehicleOverlay);
}
protected void UpdateMapButton_Click(object sender, EventArgs e)
{
InMemoryMarkerOverlay vehicleOverlay = (InMemoryMarkerOverlay)Map1.CustomOverlays["Vehicles"];
Feature vehFeature = new Feature(vehicle.GPSLocation.Longitude, vehicle.GPSLocation.Latitude);
// vehFeature.ColumnValues.Add("Status", "F");
// vehFeature.ColumnValues.Add("Status", "F");
// vehFeature.ColumnValues.Add("FeatureId", feature1.Id);
// vehFeature.ColumnValues.Add("PopupInfo", "Lat = " + vehicle.GPSLocation.Longitude.ToString());
vehicleOverlay.Features.Add(vehicle.Name, vehFeature);
// Force the Map panel to update
this.MapUpdatePanel.Update();
}
I'm aiming to attach information to the marker to make it available for a popup and context menus on the marker.
Rgds,
Liam