widget-xygo

1.2.0 • Public • Published

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

widget

Search by address

Enter an address into the search box
Select the country
Press the Enter key or the Submit button.

Select country

Response:
Address response

Search by coordinates

Enter coordinates into the search box with the following format: [latitude, longitude]

Example: [-33.44356568, -70.62951751]

Response:
Address response

Try it

Go to this website and test the widget by looking for addresses!

Readme

Keywords

Package Sidebar

Install

npm i widget-xygo

Weekly Downloads

13

Version

1.2.0

License

ISC

Unpacked Size

404 kB

Total Files

9

Last publish

Collaborators

  • trinidadmedina