How do you add a GeoJSON file into Azure Maps Typescript?

Ryan Choe 1 Reputation point
2021-08-16T21:20:17.67+00:00

I am trying to add a local GeoJSON file into my Azure Maps (Angular) and cannot add the file as a datasource due to Argument of type '{}' is not assignable to parameter of type 'FeatureCollection | Geometry | Feature<Geometry, any> | GeometryCollection | Shape | (Geometry | Feature<...> | Shape)[]'. Type '{}' is missing the following properties from type '(Geometry | Feature<Geometry, any> | Shape)[]': length, pop, push, concat, and 26 more.

How can I add the GeoJSON object as a new datasource?

Azure Maps
Azure Maps
An Azure service that provides geospatial APIs to add maps, spatial analytics, and mobility solutions to apps.
607 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. IoTGirl 2,976 Reputation points Microsoft Employee
    2021-08-18T22:47:37.957+00:00

    I am afraid I can't be much help with Angular, but Azure Maps supports GeoJSON in the Web SDK as documented here: https://learn.microsoft.com/en-us/azure/azure-maps/create-data-source-web-sdk

    1 person found this answer helpful.
    0 comments No comments