настроить высоту и ширину выноски карты ESRI - PullRequest
0 голосов
/ 04 июля 2019

здесь отформатированная строка, которую я привязываю к выноске, но я могу видеть только некоторое содержимое моей строки в выноске

private async void WebMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
    {
    try
    {
    WebMapView.DismissCallout();
    MapPoint mapLocation = null;
    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);

                        mapLocation = myEnvelopeBuilder.Center;

                        Geometry myGeometry = GeometryEngine.Project(mapLocation, SpatialReferences.WebMercator);
                        MapPoint projectedLocation = (MapPoint)myGeometry;
                        string formattedString = "";
                        if (featureAttrs.Count > 0)
                        {
                            foreach (var attributes in featureAttrs)
                            {
                                string recordOneAttribute = $"{attributes.Key}  {attributes.Value}";
                                formattedString = $"{formattedString}\n{ recordOneAttribute}";
                            }
                        }
                        CalloutDefinition calloutDef = new CalloutDefinition("Feature:",formattedString);


                        WebMapView.ShowCalloutAt(mapLocation, calloutDef);

                    }

        }
...