WebMapLocation.Constructor(Address as String)

From Xojo Documentation

Revision as of 15:50, 2 August 2019 by Gperlman (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Constructor

WebMapLocation.Constructor(Address as String)

New in 2011r2

Creates a WebMapLocation from the passed address. Invalid addresses will raise a NilObjectException.

Notes

This uses the Google Geocoding engine, and is subject to the limitations of their service.

Example

Create and display a location:

Var location As New WebMapLocation("Fenway Park, Boston, MA")
MapViewer1.GoToLocation(location)

Display a location entered by the user in the LocationField TextField:

Try
Var location As New WebMapLocation(LocationField.Text)
MapViewer1.GoToLocation(location)
Catch e As NilObjectException
MsgBox("Invalid location.")
End Try