Locator Methods
Addresses To Locations method
List<AddressCandidate> locations = await Location.AddressesToLocations( [ new Address("380 New York Street", "Redlands", "CA", "92373"), new Address("400 New York Street", "Redlands", "CA", "92373") ]);
List<AddressCandidate> locations = await Location.AddressesToLocations( [ new Address("380 New York Street", "Redlands", "CA", "92373"), new Address("400 New York Street", "Redlands", "CA", "92373") ]);
Address To Locations method
List<AddressCandidate> locations = await Locator.AddressToLocations( new Address("380 New York Street", "Redlands", "CA", "92373"), outFields: ["*"]);
List<AddressCandidate> locations = await Locator.AddressToLocations( new Address("380 New York Street", "Redlands", "CA", "92373"), outFields: ["*"]);
Location To Address method
AddressCandidate? address = await Location.LocationToAddress(new Point(longitude: -111.93, latitude: 40.74));
AddressCandidate? address = await Location.LocationToAddress(new Point(longitude: -111.93, latitude: 40.74));
Suggest Locations method
List<SuggestionResult> results = await Location.SuggestLocations( new Point(longitude: -111.93, latitude: 40.74), "1");
List<SuggestionResult> results = await Location.SuggestLocations( new Point(longitude: -111.93, latitude: 40.74), "1");
About this sample
This GeoBlazor sample, written in Blazor for .NET developers, demonstrates GeoBlazor's LocationService which wraps the ArcGIS Maps SDK for JavaScript Locator REST module for geocoding and reverse geocoding. The page is a documentation-style reference of four LocationService methods, each presented with a syntax-highlighted C# code snippet, an action button, and a result panel: Addresses To Locations (batch forward-geocode a list of Address records to coordinates with confidence scores), Address To Locations (forward-geocode a single Address with extended OutFields), Location To Address (reverse-geocode a Point to a street address), and Suggest Locations (return autocomplete suggestions for partial input near a given Point). Clicking each button invokes the corresponding LocationService call against the ArcGIS World GeocodeServer and renders the returned AddressCandidate or SuggestionResult collection beneath the button. The sample is intended to demonstrate how to perform geocoding entirely in C# from a Blazor application without writing JavaScript.