O'Reilly logo

ArcGIS By Example by Hussein Nasser

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Finding and highlighting the closest tower

We know how to add a point on the map and we also know how to find the distance between two points. What remains is finding the closest tower to the cell phone we are adding on the map. To do that, we need to find the distance between the point we are adding and all the towers. Compare all the distances and the shortest distance is the closest to the point. We will then get the tower name and display it as a message. Later, we will learn how to use the display object to highlight and flash that tower.

Finding the closest tower

To find the closest tower, we need to loop through all towers and run the same proximity code. While looping, we will take note of the shortest distance and save the corresponding ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required