Hi,
I tweaked my application a bit and now I get a problem.
My base map layer came off a mapserver for a town. It draws all the layers and forms a map. I carry out various tasks on this layer. But this map didn't look very impressive so I decided to add a world map layer first (now the base layer), and added the town layer on the top of that as a secondary layer. Doing this affected a major functionality -- when I apply IdentifyTask on the secondary layer, it doesn't identify anything. Why?
Here's my implementation
private void LayerDetailLink_Click(object sender, RoutedEventArgs e)
{
Point _point = _currentMouseoffset;
MapPoint _mapPoint = MyMap.ScreenToMap(_point);
IdentifyParameters identifyParams = new IdentifyParameters()
{
Geometry = _mapPoint,
MapExtent = MyMap.Extent,
Width = (int)MyMap.ActualWidth,
Height = (int)MyMap.ActualHeight,
LayerOption = LayerOption.all
};
IdentifyTask identifyTask = new IdentifyTask(NewMapLayer.Url);
identifyTask.ExecuteCompleted += new EventHandler<IdentifyEventArgs>(identifyTask_ExecuteCompleted);
identifyTask.Failed +=new EventHandler<TaskFailedEventArgs>(identifyTask_Failed);
identifyTask.ExecuteAsync(identifyParams);
GraphicsLayer graphicsLayer = MyMap.Layers["NewMapLayer"] as GraphicsLayer;
Graphic graphic = new Graphic()
{
Geometry = _mapPoint,
Symbol = DefaultPictureSymbol
};
}
Any help would be appreciated,
thanks 🙂