单张地图游戏服务器承载
Leaflet is one of the main Javascript-based mapping frameworks. It is widely used across the Industry to add interactive maps to web sites and applications.
大号 eaflet是主要基于Javascript的映射框架中的一个。 它在整个行业中被广泛使用,以向网站和应用程序添加交互式地图。
However, it can be tricky to include in Angular.io apps. It does not exactly play nicely with either Angular or Typescript. After I had the adventure of migrating a Leaflet map-based site to Angular 8 it was clear to me that there was no really good reference for this task. These posts are my attempt to document the learnings.
但是,将其包含在Angular.io应用程序中可能会很棘手。 它与Angular或Typescript都不能很好地播放。 在经历了将基于Leaflet地图的站点迁移到Angular 8的冒险之后,对我来说很明显,此任务没有真正好的参考。 这些帖子是我尝试记录学习的内容。
This is going to be a multi-part post :
这将是一个多部分的帖子:
- The basics (this post), 基础知识(本文),
添加控件 ,
Custom Controls, and
The objective of this series is to that you will be able to create a Leaflet map in an Angular-CLI based project without hassle, fuss and dead-ends.
本系列文章的目的在于,您将能够在基于Angular-CLI的项目中创建一个Leaflet贴图,而不会遇到麻烦,烦恼和死胡同。
背景 (Background)
It turns out that, although adding Leaflet to Angular.io is not significantly hard it is very “fiddly” since Leaflet is not particularly Angular (or Typescript) friendly. Leaflet uses a global L
variabl