Forum Xamarin.Forms

Announcement:

The Xamarin Forums have officially moved to the new Microsoft Q&A experience. Microsoft Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

To create new threads and ask questions head over to Microsoft Q&A for .NET and get involved today.

Can we create a custom callout like grid in xamrin.forms. Please provide me an example Ask

The map callout should appear as a grid which shows the all the attributes of feature tabbed in web map view and we can edit the features too.

Tagged:

Answers

  • curious0612curious0612 Member ✭✭
    edited July 2019

    actually i want the grid should appear as map callout like stated in this image url
    -1

    " url ---> https//community.esri.com/servlet/JiveServlet/showImage/2-710907-368724/Callout.png-->"

  • curious0612curious0612 Member ✭✭
    edited July 2019

    I have previously seen this example But this grid example does not diaplays the details in grid as the map callout i have stated in the image.

    Here Is the function which works on tabbing a point on webmap view

    private async void WebMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e) { try { WebMapView.DismissCallout();

            var layers = await WebMapView.IdentifyLayersAsync(e.Position, 20, false);
            if (layers.Count > 0)
            {
                foreach (var idResults in layers)
                {
                    FeatureLayer idLayer = idResults.LayerContent as FeatureLayer;
    
                    await idLayer.LoadAsync();
    
    
                    var result = layers.First();
                    var feature = result.GeoElements.First() as ArcGISFeature;
                    await feature.LoadAsync(); // Load feature to get all attributes
                    Feature idFeature = result.GeoElements.First() as Feature;
                    featureAttrs = idFeature.Attributes;
    
                    var stateExtent = idFeature.Geometry;
    
                    Graphicoverlay = new GraphicsOverlay();
                    Graphic graphicLine = null;
    
                    graphicLine = new Graphic(stateExtent, AppConstant.HighLight1);
                    Graphicoverlay.Graphics.Add(graphicLine);
    
                    EnvelopeBuilder myEnvelopeBuilder = new EnvelopeBuilder(SpatialReferences.WebMercator);
                    //Geometry abd = oneGraphic.Geometry;
                    myEnvelopeBuilder.UnionOf(graphicLine.Geometry.Extent);
                    myEnvelopeBuilder.Expand(1.3);
    
                    MapPoint mapLocation = myEnvelopeBuilder.Center;
    
                    Geometry myGeometry = GeometryEngine.Project(mapLocation, SpatialReferences.WebMercator);
                    MapPoint projectedLocation = (MapPoint)myGeometry;
    
        WebMapView.ShowCalloutAt(
                     mapLocation,
                    new Esri.ArcGISRuntime.UI.CalloutDefinition(feature));
    
    
                    WebMapView.GraphicsOverlays.Add(Graphicoverlay);
    
    
    
                }
            }
    
        }
        catch (Exception ex)
        {
    
            throw;
        }
    }
    

    Now where I am setting feature in the callout i want the feature attributes to beshown in grid format in map callout and i have all the feature attributes and i have bind them in grid but unable to show that grid in map callout

Sign In or Register to comment.