Hi everybody,
I am trying to Draw image on the map with the following code:
public class MyValueStyle : ValueStyle
protected override void DrawCore(IEnumerable<Feature> features, GeoCanvas canvas, Collection<SimpleCandidate> labelsInThisLayer, Collection<SimpleCandidate> labelsInAllLayers)
{
List<Feature> listFeatures = new List<Feature>();
foreach (Feature feature in features)
{
listFeatures.Add(feature);
GeoImage image = new GeoImage(new Uri(@"..\..\Resource\lawrencecity.jpg", UriKind.RelativeOrAbsolute));
canvas.DrawWorldImageWithoutScaling(image, ((PointShape)feature.GetShape()).X, ((PointShape)feature.GetShape()).Y, 0, 0, 0);
}
if (listFeatures.Count > 2)
{
LineShape line = new LineShape();
Vertex vertex1 = new Vertex((PointShape)listFeatures[listFeatures.Count - 2].GetShape());
Vertex vertex2 = new Vertex((PointShape)listFeatures[listFeatures.Count - 1].GetShape());
line.Vertices.Add(vertex1);
line.Vertices.Add(vertex2);
canvas.DrawLine(line, new GeoPen(GeoColor.GeographicColors.Forest));
}
}
As a result of this code I can see the green line being drawn (the one that I draw with DrawLine method), so the coordinates of the image (same coordinates) are Ok.
So what is the problem?
I tried to compile the image in Resources of the Silverlight project as Resource, Embedded Resource, Content with Always Copy option - nothing.
Any help would be appreciated.
Maxim