In the past, I've used InfoTemplates to display layer attributes using the ArcGIS API for JavaScript.

Now, I'm trying to make a Xamarin Forms app using the ArcGIS SDK for .NET. I'm stuck trying to figure out a way to get similar functionality. I want to be able to display a callout for each layer when a user touches the screen. I found this, but the map I'm consuming doesn't have any popups.

What I really want to do is to get the layer's attributes and use them to display a callout (or multiple callouts - one for each layer).

Is this possible with this sdk?

Is there a better way to accomplish what I'm trying to do?

I'm not looking for someone to write the code for me, just a nudge in the right direction or a link to something I can follow.

** Edit **

Ok, I'm able to get the attributes for a layer by doing the following:

 private async void MyMapView_GeoViewTapped(object sender, GeoViewInputEventArgs e)
            var queryParams = new QueryParameters();

            queryParams.WhereClause = "1 = 1";
            var results = await _featureTable.QueryFeaturesAsync(queryParams);

            foreach(var result in results)
                var attst = result.Attributes;
        catch (Exception ex)
            DisplayAlert("Ugh!", ex.Message, "Close");

Now, how can I get the layer(s) that contain a given point where the user touched (e.Location.X and e.Location.Y)?

  • I'm assuming that you are using the ArcGIS API for JavaScript 4.x. If it is something else please revise your question. – PolyGeo Feb 7 '18 at 20:23
  • @PolyGeo No, I'm not using the JavaScript sdk. I'm using the sdk for .net. – Matt M Feb 7 '18 at 20:24
  • That contradicts your opening paragraph. – PolyGeo Feb 7 '18 at 20:41
  • @PolyGeo Sorry for the confusion. I was trying to say that I've used the javascript api and know how to display a window using InfoTemplates. I'll edit the question to make that more clear...hopefully. – Matt M Feb 7 '18 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.