Records Near a Place

AllowNearSearch (React: allowNearSearch) puts a Near button on a map's or a grid's toolbar. It finds a place — an address, with the map provider's own search, or the visitor's location — and shows only the records within the distance chosen, nearest first, with how far each one is. NearDistances sets the distances on offer, NearDistance the one it starts at, and the unit switches between miles, the default, and kilometers. The server reads the records by their coordinates with the visitor's permissions, and returns the nearest 500 at most (NearSearchOptions.MaximumMatches).

On a Map

The demo's accounts and contacts. Choose Near on the map's toolbar, then type a US city or address — Denver, say — or use your location. The map shows only the accounts and contacts within the distance, the circle drawn, and each popup says how far its record is. Change the distance or switch to kilometers and the map follows.

React example Blazor example React TypeScript Razor

In a Grid

The demo's contacts. Choose Near beside the search box and find a place: the grid lists the contacts within the distance, nearest first, with a Distance column. Click its header to list the farthest first, or another column's to sort by it instead. Pick Map or Map only from the layout dropdown to see the circle. The place is kept in the page's address, so a link brings it back.

React example Blazor example React TypeScript Razor