简体   繁体   中英

Angular-2 Mapzen Integration

How do I go about integrating Mapzen in an Angular-2 application.

Their tutorial has the following code. How would I implement this in an Angular application?

  <head>
    <meta charset="utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="stylesheet" href="https://mapzen.com/js/mapzen.css">
    <script src="https://mapzen.com/js/mapzen.min.js"></script>

    <style>
      #map {
        height: 100%;
        width: 100%;
        position: absolute;
      }
    html,body{margin: 0; padding: 0}
  </style>

  </head>
  <body>
    <div id='map'></div>
    <script>
      var map = L.Mapzen.map('map', {
        center: [47.61033,-122.31801],
        zoom: 16,
        scene: L.Mapzen.BasemapStyles.BubbleWrap
      });
    </script>
  </body>

This code is a sample from Mapzen's JavaScript SDK, known as mapzen.js , which simplifies the process of using Mapzen's maps with the Leaflet JavaScript mapping library.

This means that you will first need to get Leaflet working with Angular. I have not tried it, but a library like this might be a place to start: https://github.com/tombatossals/angular-leaflet-directive

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM