Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Find nearby addresses using Lat & Long

(0) ShareShare
ReportReport
Posted on by 1,720

Hi

I have a custom entity 'Property' that stores the address details along with Latitude and Longitude. I want to be able to perform a search on this entity and find all properties within a certain radius (say 5km) of a given address. Does anyone know how this can be achieved?

Thanks 

*This post is locked for comments

  • Suggested answer
    Inogic Profile Picture
    462 on at
    Find nearby addresses using Lat & Long
    Hi there,

    As a quick hack, you can explore Radius/ Proximity Search by Maplytics within Dynamics 365. The app integrates Maps with Dynamics 365 and allows users to visualize CRM records on the map.

    Using the Radius Search feature, you can select one of your ‘property’ entities as the current location, specify a radius for search, say 5 km, and visualize all the properties within that travel distance.

    This is so quick that the results are plotted even before you would blink. For more details and to explore other features of Maplytics, check out the website or connect with the team at crm@inogic.com.
     
    Thanks,
    Sam
  • Suggested answer
    BadrinathB Profile Picture
    970 on at
    RE: Find nearby addresses using Lat & Long

    Hi Mir,

    Below could be some of the options for you to achieve this

    1. Use Bing or google maps and ingrate your CRM. Not sure how much you can full fill your businees requirements with this.

    2. Use 3 rd party tools like nutshell to achieve this www.nutshell.com/.../introducing-nutshell-maps

    3. Custom code either JS or Plugin to find and associate the properties based on their long and lat

    Algorithams to achieve this are well explained in the below article

    www.movable-type.co.uk/.../latlong.html

    stackoverflow.com/.../calculate-distance-between-two-latitude-longitude-points-haversine-formula

    function getDistanceFromLatLonInKm(lat1,lon1,lat2,lon2) {

     var R = 6371; // Radius of the earth in km

     var dLat = deg2rad(lat2-lat1);  // deg2rad below

     var dLon = deg2rad(lon2-lon1);

     var a =

       Math.sin(dLat/2) * Math.sin(dLat/2) +

       Math.cos(deg2rad(lat1)) * Math.cos(deg2rad(lat2)) *

       Math.sin(dLon/2) * Math.sin(dLon/2)

       ;

     var c = 2 * Math.atan2(Math.sqrt(a), Math.sqrt(1-a));

     var d = R * c; // Distance in km

     return d;

    }

    function deg2rad(deg) {

     return deg * (Math.PI/180)

    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

🌸 Community Spring Festival 2025 Challenge 🌸

WIN Power Platform Community Conference 2025 tickets!

Jonas ”Jones” Melgaard – Community Spotlight

We are honored to recognize Jonas "Jones" Melgaard as our April 2025…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 294,137 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 232,877 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,158 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans