Hello,
I have just switched over from evaluating the Silverlight version of map suite and I have a few questions.
What I want to do is have a custome feature layer that respresents the physical location of a station and the associate symbology for alarm states. I have that working.
Each station has a variety of measurements. I want to create a marker layer for each measurement that has a popup for each measurement. the user can then choose a measurement and receive different popups on the same station icons. Hiding all the marker layers but one works.
The problem I am having is that I only want the icons from my custom feature layer. I do not want the markerlayer icons to be visible. However I do want the popups and HTML(text) to be visible for the Marker layer and change with each layer. I have tried turning the marker to IsVisible = false but that turns the html and popups off as well.
Is there a way to do this.
Here is the code I am using for my MakerOverlay
SimpleMarkerOverlay testMarkerOverlay = new SimpleMarkerOverlay();
Marker test = new Marker(-118.19, 34.64);
CustomPopup cp1 = new CustomPopup("p1", test.Position, "<img src='Pipelines.jpg' />", 300, 200, false, false, 2);
cp1.IsVisible = false;
test.Popup = cp1;
testMarkerOverlay.Markers.Add(test);
Map1.CustomOverlays.Add(mapoverlay);
//Map1.CustomOverlays.Add(testMarkerOverlay);
Map1.CustomOverlays.Add(ShapeFiles1);
Map1.CustomOverlays.Add(testMarkerOverlay);
Here is the code for by customer Feature Layer
//declare a new EyascofeatureLayer
EyascoFeatureLayer EFL = new EyascoFeatureLayer();
//Get Layer Style Style st = ((EyascoFeatureSource EFL.FeatureSource).GetAlarmStyle();
EFL.ZoomLevelSet.ZoomLevel01.CustomStyles.Add(st);
EFL.ZoomLevelSet.ZoomLevel01.ApplyUntilZoomLevel = ApplyUntilZoomLevel.Level20; ShapeFiles1.Layers.Add(EFL);
namespace ThinkGeo2
{
public class EyascoFeatureCache : ThinkGeo.MapSuite.Core.FeatureCache
{
private RectangleShape rec01;
public EyascoFeatureCache()
{
Init();
}
public void Init()
{
PointShape ulpnt = new PointShape(-118.15, 34.8);
PointShape lrpnt = new PointShape(-117.6, 32.7);
rec01 = new RectangleShape(ulpnt, lrpnt);
//create first "station"
Collection<string> attr = new Collection<string>();
attr.Add("stnId:1");
attr.Add("alarm:Level1");
Feature F1 = new Feature(-118.19, 34.64, "1", attr);
//Create second "station"
attr.Clear();
attr.Add("stnId:5");
attr.Add("alarm:Level2");
Feature F2 = new Feature(-117.9, 34.2, "2", attr);
//Create Third "station"
attr.Clear();
attr.Add("stnId:7");
attr.Add("alarm:Level3");
Feature F3 = new Feature(-118.05, 33.9, "3", attr);
Collection<feature> featureColl = new Collection<feature>();
featureColl.Add(F1);
featureColl.Add(F2);
featureColl.Add(F3);
Add(rec01, featureColl);
}
public RectangleShape getBounds()
{
return this.rec01;
}
}
namespace ThinkGeo2
{
public class EyascoFeatureSource : ThinkGeo.MapSuite.Core.FeatureSource
{
protected FeatureSourceColumn stnId;
protected FeatureSourceColumn alarm;
protected Collection<featuresourcecolumn> fsColl; protected ValueStyle alarmStyle;
protected ValueItem Level1;
protected ValueItem Level2;
protected ValueItem Level3;
public EyascoFeatureSource()
{
//add columns to features
stnId = new FeatureSourceColumn("stnId", "string", 20);
alarm = new FeatureSourceColumn("alarm", "string", 20);
fsColl = new Collection<featuresourcecolumn>();
fsColl.Add(stnId);
fsColl.Add(alarm);
//set the alarm style
Level1 = new ValueItem("Level1", PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Green, 15, GeoColor.FromHtml("White"), 3));
Level2 = new ValueItem("Level2", PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Yellow, 20, GeoColor.FromHtml("Black"), 1));
Level3 = new ValueItem("Level3", PointStyles.CreateSimpleCircleStyle(GeoColor.SimpleColors.Red, 25, GeoColor.FromHtml("Black"), 1));
Collection<valueitem> cv = new Collection<valueitem>();
cv.Add(Level1);
cv.Add(Level2);
cv.Add(Level3);
alarmStyle = new ValueStyle("alarm", cv);
GeoCache = new EyascoFeatureCache();
}
protected override Collection<feature> GetAllFeaturesCore(IEnumerable<string> returningColumnNames)
{
EyascoFeatureCache test = new EyascoFeatureCache();
return GeoCache.GetFeatures(test.getBounds());
}
protected override Collection<featuresourcecolumn> GetColumnsCore()
{
return fsColl;
}
public Style GetAlarmStyle()
{
return alarmStyle;
}
}
So Basically I need to know if it is possible to have a Marker Layer active for Popups and HTML but have the actual Icon either transparent of invisible. I was hoping to use a stack of Marker layers to control the different measurements (popups) all at the same location represented by the feature layer.
Any help would be greatly appreciated and thanks in advanced for your response.
Leon