//define 3 different overlays, add them into the Map1.CustomOverlays with the specified sequence. LayerOverlay areaOverlay = new LayerOverlay(); LayerOverlay lineOverlay = new LayerOverlay(); LayerOverlay pointOverlay = new LayerOverlay(); Map1.CustomOverlays.Add(pointOverlay); Map1.CustomOverlays.Add(lineOverlay); Map1.CustomOverlays.Add(areaOverlay); //when adding shape file layers dynamically, add them to the relative overlays depending on the shape file type. ShapeFileFeatureLayer layer = new ShapeFileFeatureLayer(); layer.Open(); ShapeFileType type = layer.GetShapeFileType(); if (type == ShapeFileType.Multipoint || type == ShapeFileType.MultipointM || type == ShapeFileType.MultipointZ || type == ShapeFileType.Point || type == ShapeFileType.PointM || type == ShapeFileType.PointZ) { pointOverlay.Layers.Add(layer); } // // else line // else polygon //OnMapClick foreach (LayerOverlay overlay in Map1.CustomOverlays) { foreach (ShapeFileFeatureLayer item in overlay.Layers) { Collection features = item.QueryTools.GetFeaturesIntersecting(mousePoint, ReturningColumnsType.AllColumns); if (features.Count > 0) { //the features are what you want. } } }