npm package: @smartmaps/services-core
Description: Core functions for @smartmaps services
Latest version: 5.1.1

# SmartMaps

<img src="https://www.smartmaps.net/wp-content/uploads/2022/09/SmartMaps_poweredby.svg"
     alt="SmartMaps - powered by YellowMap AG"
     width="500" /><br>
SmartMaps is a GDPR-compliant map platform developed by YellowMap AG. The focus of the platform is the digital sovereignty of users. Based on OpenStreetMap data, SmartMaps offers individually customizable functions such as maps, geocoding, autocomplete or routing for the visualization of points of interest, internal location analyses or address validations. SmartMaps is certified with the seals 'Software Hosted in Germany' and 'fair.digital'. These confirm a GDPR-compliant, transparent and data-saving handling of personal information.

To get started with SmartMaps, register for free at [SmartMaps](https://www.smartmaps.net/pricing)

For more information visit our [Examples](https://docs.yellowmap.com/en/smartmaps-javascript-en/examples/map-functionality/) or [Documentation](https://docs.yellowmap.com/)

## Install

```
import { Geocoder, GeocoderResponseAddress } from '@smartmaps/geocoding';

const geocoder = new Geocoder(apiKey);

// getting the address of the current Position:
navigator.geolocation.getCurrentPosition((currentPosition) => {
	const { coords: { latitude, longitude } } = currentPosition;
	geocoder.geocodeReverse({ lat: latitude, lng: longitude }).then((response) => {
		const address = response.features[0].properties;
		// address is of type GeocoderResponseAddress

    	// todo: do something with the address
    }

}

// get the position of the current search
const position = await geocoder.geocodeString("CAS-Weg 1, 76185 Karlsruhe");

// get the position of an address
const position = await geocoder.geocode({
		city : "Karlsruhe",
		street: "CAS Weg 1",
		zip: "76185"
	}
);

```

## Features

### Maps ([@smartmaps/maps](https://www.npmjs.com/package/@smartmaps/maps))

Maps is the globally usable map base for your industry-specific requirements. Whether you want to visualize location data, business data or socio-demographic data on the web, internal applications or an app.

### Autocomplete ([@smartmaps/autocomplete](https://www.npmjs.com/package/@smartmaps/autocomplete))

A few letters are enough to inspire your customers. With the Autocomplete function, suitable suggestions are already recommended when the first letters are entered in the address search. Autocomplete is easily customizable through parameters like local boosting.

### Geocoding ([@smartmaps/geocoding](https://www.npmjs.com/package/@smartmaps/geocoding))

With the help of geocoding, you convert postal addresses into coordinates and visualize them on the map with pinpoint accuracy. Reverse geocoding allows you to convert an existing coordinate from an automatic location into an address in the opposite way.

### Routing ([@smartmaps/routing](https://www.npmjs.com/package/@smartmaps/routing))

Show your customer the way to your location and navigate him safely to the desired destination - whether on foot, by bike or by car. Use the routing API not only for classic A-B routing, but also for matrix routing, the calculation of isochrones, trip planning or map match.