Welcome
SmartMaps JS SDK v5 is a powerful JavaScript library that enables you to integrate interactive maps into your web applications. SmartMaps provides a globally usable map base that can be tailored to your industry-specific requirements. Whether you want to visualize location data, business data, or socio-demographic data on the web, internal applications, or mobile apps, SmartMaps has you covered.
Choosing a version
v5 is a good fit in particular for raster-tile use cases. For new vector-map projects we recommend SmartMaps GL (better performance and customization). Looking for the older JS API v3? Its documentation is still available here.
Getting Started
To start using SmartMaps JS API v5, follow these steps:
-
Sign up for a free account at SmartMaps to obtain your API key.
-
Install the SmartMaps library via npm:
-
Import the
mapfunction from the library: -
Create a map instance by passing the HTML element or CSS selector where you want the map to be displayed, your API key, and the initial center coordinates and zoom level:
-
Add a
divelement with a specific ID where you want the map to be rendered: -
Ensure that the map container has a defined height by setting it in your CSS:
-
Import the SmartMaps styles from
node_modules/@smartmaps/maps/dist/smartmaps-maps.css. The exact method depends on your build process. If you're not using a build tool like Webpack or Rollup, you can copy the file from thenode_modulesdirectory to a folder hosted in your app and load it via an HTMLlinktag:
With SmartMaps JS API v5, you can create interactive and feature-rich maps while prioritizing user privacy and data protection. Leverage the power of SmartMaps to enhance your web applications with location-based functionality and deliver a seamless user experience.