Azure Maps: How to install version 3 of the azure-maps-control package

67 views Asked by At

I tried to install the new version 3.x azure-maps-control npm package but it seems to have some problems with Typescript:

  1. It refers to an azuremaps-maplibre-gl module which cannot be found anywhere. Normal maplibre-gl exists but I suppose that the Azure Maps team made some changes to the vanilla version. This dependency seems to be introduced in version 3.0.0-preview.9.

Errors in azure-maps-control/typings/index.d.ts:

  1. line 674:23 - error TS2300: Duplicate identifier 'options'. (also defined on line 671:23)
  2. line 674:23 - error TS2717: Subsequent property declarations must have the same type. Property 'options' must be of type 'boolean', but here has type 'PitchControlOptions'.
  3. line 2135:51 - error TS2304: Cannot find name 'ElevationTileSource'.
  4. line 4097:49 - error TS1246: An interface property cannot have an initializer.
  5. line 4101:44 - error TS1246: An interface property cannot have an initializer.
  6. line 4105:70 - error TS1246: An interface property cannot have an initializer.
  7. line 4109:24 - error TS1246: An interface property cannot have an initializer.

Is this an oversight by the Azure Maps team? Or do I use the package wrong?

EDIT for people reading this in the future: Package versions starting from 3.0.2 are fixed.

1

There are 1 answers

0
rbrundritt On BEST ANSWER

There is a known bug in the current NPM package release. The Azure Maps team is looking into this. There is a thread tracking this here: https://github.com/Azure-Samples/AzureMapsCodeSamples/issues/116