2.2.3 • Published 15 days ago

@nextgis/geocoder v2.2.3

Weekly downloads
15
License
MIT
Repository
github
Last release
15 days ago

Geocoder

size version

Geocoder is a versatile library designed for intuitive geocoding functionalities. With an emphasis on ease-of-use, it supports multiple providers to cater to diverse requirements, allowing developers to seamlessly integrate geocoding into their applications.

Built-in providers

  • NgwProvider: Specifically for the NGW vector layer, ideal for applications that rely on NextGIS services.
  • NominatimProvider: Utilizes the Nominatim geocoding service, suitable for applications requiring free geocoding services with OpenStreetMap data.

Installation

In Browser

Include assets

Simply download and include with a script tag, Geocoder will be registered as a global variable.

<script src="../lib/geocoder.global.js"></script>

<script>
  var geocoder = Geocoder.create({
    ...options
  });
</script>

CDN

unpkg

<script src="https://unpkg.com/@nextgis/geocoder"></script>

jsdelivr

<script src="https://cdn.jsdelivr.net/npm/@nextgis/geocoder"></script>

We recommend linking to a specific version number /geocoder@[version]

In Node.js

npm install @nextgis/geocoder

Usage

Basic Usage with NGW Provider

import { Geocoder, NgwProvider } from '@nextgis/geocoder';

// Initialize the NGW Provider
const ngwProvider = new NgwProvider({
    connectorOptions: {
        baseUrl: 'https://demo.nextgis.com',
    },
    searchResources: [
        {
            resourceId: 4224,
            limit: 3,
        },
        // ... other resources
    ],
});

// Initialize the geocoder
const geocoder = new Geocoder({ providers: [ngwProvider] });

// Use geocoder.search() for geocoding queries
const searchQuery = "example_search_query"; // Replace with your search term
const geocoderGenerator = geocoder.search(searchQuery);

// Iterate over the geocoder generator to get the search results
for await (const item of geocoderGenerator) {
    console.log(item.text); // Log the item name or description
    item.result().then(({ extent }) => {
        // Use the result's extent or other properties as needed
        console.log(extent);
    });
    break;
}

Check out the API Documentation

Commercial support

Need to fix a bug or add a feature to @nextgis/geocoder? We provide custom development and support for this software. Contact us to discuss options!

http://nextgis.com

2.2.3

15 days ago

2.1.1

1 month ago

2.1.0

2 months ago

2.0.2

2 months ago

2.0.0

2 months ago

2.0.0-alpha.2

2 months ago

2.0.0-alpha.1

2 months ago

2.0.0-alpha.0

3 months ago

1.19.2

5 months ago

1.19.1

5 months ago

1.18.3

8 months ago

1.18.9

8 months ago

1.18.6

8 months ago

1.19.0

6 months ago

1.17.0

8 months ago

1.18.21

6 months ago

1.18.12

7 months ago

1.18.11

7 months ago

1.18.10

7 months ago

1.18.15

7 months ago

1.18.19

6 months ago

1.18.18

6 months ago

1.18.17

6 months ago

1.16.8

1 year ago

1.16.7

1 year ago

1.16.6

1 year ago

1.16.5

1 year ago

1.16.2

2 years ago

1.16.1

2 years ago

1.16.0

2 years ago

1.14.0

2 years ago

1.15.0

2 years ago

1.15.1

2 years ago

1.13.2

2 years ago

1.13.5

2 years ago

1.12.1

2 years ago

1.12.0

2 years ago

1.11.3

2 years ago

1.11.8

2 years ago

1.11.10

2 years ago

1.11.2

2 years ago

1.9.4

3 years ago

1.11.0

2 years ago

1.9.3

3 years ago

1.9.2

3 years ago

1.8.4

3 years ago

1.8.3

3 years ago

1.8.2

3 years ago

1.8.0

3 years ago

1.7.0

3 years ago

1.5.1

3 years ago

1.5.0

3 years ago

1.4.0

3 years ago

1.3.0

3 years ago

1.2.8

3 years ago

1.2.7

3 years ago

1.2.3

3 years ago

1.2.2

3 years ago

1.2.1

3 years ago

1.2.0

3 years ago

1.1.2

3 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago

1.0.0-beta.10

3 years ago

1.0.0-beta.7

3 years ago

1.0.0-beta.8

3 years ago

1.0.0-beta.9

3 years ago

1.0.0-beta.6

3 years ago

1.0.0-beta.5

3 years ago

1.0.0-beta.4

3 years ago

1.0.0-beta.3

3 years ago

1.0.0-beta.2

3 years ago

1.0.0-beta.1

4 years ago

1.0.0-beta.0

4 years ago

1.0.0-alpha.11

4 years ago

1.0.0-alpha.10

4 years ago

1.0.0-alpha.9

4 years ago

1.0.0-alpha.8

4 years ago

1.0.0-alpha.7

4 years ago