azure-maps-control
TypeScript icon, indicating that this package has built-in type declarations

3.1.2 • Public • Published

Azure Maps Web Control

The Azure Maps Web Control lets you customize interactive maps with your own content and imagery for display in your web or mobile applications. This control makes use of WebGL, allowing you to render large data sets with high performance. Develop with the control using JavaScript or TypeScript.

How to Install

You can embed the Azure Maps V3 Web Control source code into your app by installing the NPM package:

NPM

npm install azure-maps-control

This package includes a minified version of the source code, CSS stylesheet, as well as the TypeScript definitions for the Azure Maps Web Control.

You would also need to embed the CSS stylesheet for various controls and popups to show correctly. You may find it under /node_modules/azure-maps-control/dist/atlas.min.css. If you are using a javascript bundler to bundle the dependencies and package your code, refer to your bundler's documentation on how this is done.

Webpack

For webpack, it is commonly done via a combination of style-loader and css-loader with documentation available at style-loader.

To begin, install style-loader and css-loader:

npm install --save-dev style-loader css-loader

Inside your source file, import atlas.min.css:

src/index.ts:

require('../node_modules/azure-maps-control/dist/atlas.min.css');

then add loaders to the module rules portion of the webpack config:

module.exports = {
  module: {
    rules: [
      {
        test: /\.css$/i,
        use: ["style-loader", "css-loader"],
      },
    ],
  },
};

Additional notes

If you are using MapControl inside create-react-app based project, make sure your browserlist settings do not include IE11, since it is no longer supported (not ie 11).

CDN

Alternatively, you can also reference the hosted version of the Azure Maps V3 Web Control by adding the following script tags directly to your application.

<link rel="stylesheet" href="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.css" type="text/css" />
<script src="https://atlas.microsoft.com/sdk/javascript/mapcontrol/3/atlas.min.js"></script>

Developer Resources

Related Packages

release note

Please refer to release note for more information.

Package Sidebar

Install

npm i azure-maps-control

Weekly Downloads

13,987

Version

3.1.2

License

SEE LICENSE IN LICENSE.TXT

Unpacked Size

28.3 MB

Total Files

19

Last publish

Collaborators

  • azuremaps