ThinkGeo.com    |     Documentation    |     Premium Support

How to display multiple popups connected by lines to nearby features (star layout)

Hi everyone,

I’m trying to create with ThinkGeo.Android a visualization similar to Google Earth, where several popups appear around a central point , each one connected by a line to its corresponding feature.

In my case, I’m using GetFeaturesNearby() to retrieve the features around a given location. For each nearby feature, I’d like to:

  • Display a popup (showing its name or attributes), and
  • Draw a line from the popup back to the feature’s location,
    so that all popups are arranged in a “star” layout around the clicked point.

Could anyone please advise on how to best implement this with ThinkGeo?
In particular, what’s the best way to handle the popup positioning and the connecting lines?

Thanks a lot for any ideas or examples!

Best Regards,

image

Hi Ati,

I think you are using .NET 8+ Android, right? There isn’t a built-in feature for this, but you can achieve it by customizing the TrackOverlay —the class responsible for drawing features on the map.

Here’s what I suggest:

  1. Review this sample to learn how to use TrackOverlay to draw a line:
    samples/Android/DrawAndEditFeatures · support/v10 · ThinkGeo / Public / Mobile Maps · GitLab
    Please note that this sample uses the legacy Xamarin.Android platform. You’ll need to make a few adjustments to match your environment.

  2. After creating a popup , draw a line connecting the feature and the popup. Make sure to update/redraw this line whenever the popup’s position changes.

Give it a try, and feel free to reach out if you run into any questions or issues.

Thanks,
Ben