widget-xygo
v1.2.0
Published
Map widget with integrated Xygo searcher
Downloads
21
Readme
xygo-widget
Map widget with integrated Xygo searcher
Installation
npm install widget-xygo
Dev usage
Import the package
import { Widget } from 'widget-xygo';
Instantiate the class
const widget = new Widget ({
apiKey: 'xxxxxxxxxxxxxxxxxxxx', // provide arcgis developer api key. Required
token: 'xxxxxxxxxxxxxxxxxxxxx', // provide security token. Required
position: 'bottom-left' || 'bottom-right' || 'top-left' || 'top-right' , // optional property: default value is 'bottom-right'
button: true || false // optional property: default value is false
});
Get address or coordinates
Capture the address or coordinates of a specific point with a click on the map.
const address = await widget.getAddress()
Usage
Search by address
Enter an address into the search box
Select the country
Press the Enter key or the Submit button.
Response:
Search by coordinates
Enter coordinates into the search box with the following format: [latitude, longitude]
Example: [-33.44356568, -70.62951751]
Response:
Try it
Go to this website and test the widget by looking for addresses!