当前位置: 首页 > 软件库 > 程序开发 > >

ember-leaflet

🔥 🍃 Easy and declarative mapping for ember
授权协议 MIT License
开发语言 JavaScript
所属分类 程序开发
软件类型 开源软件
地区 不详
投 递 者 沃宇
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

ember-leaflet CI

Ember-Leaflet aims to make working with Leaflet layers in your Ember app as easy, declarative and composable as templates make working with DOM.

Installation

Ember Leaflet works in Ember 3.16+ with no deprecations.

To install it run:

ember install ember-leaflet

This will also add the leaflet package to your project.

ember-leaflet is compatible with leaflet 0.7+. If you need to use a legacy version, you can just install it via npm / yarn:

npm install --save-dev leaflet@0.7
yarn add -D leaflet@0.7

Support, Questions, Collaboration

Join Ember on Discord

Usage

Documentation and examples are hosted at https://miguelcobain.github.io/ember-leaflet/.Please file any issues if you see that something can be improved.

Production Builds

In your ember-cli-build.js add the following snippet:

let app = new EmberApp(defaults, {
  // Add options here
  fingerprint: {
    exclude: [
      'images/layers-2x.png',
      'images/layers.png',
      'images/marker-icon-2x.png',
      'images/marker-icon.png',
      'images/marker-shadow.png'
    ]
  }
});

ember-cli does fingerprinting (appending an md5 checksum to the end of every file) for production builds by default (http://ember-cli.com/user-guide/#fingerprinting-and-cdn-urls). Exclude the leaflet assets so that your production build produces them correctly.

Overview

Web apps frequently need to display geographic data, especially if it has a direct relationship with the real world. That isn't new, and has been done previously in all kinds of formats, particularly with raster and vector data.

Ember apps naturally may have the same requirements and until now, devs have been either using mapping libraries outside of ember scope, or using previous versions of ember-leaflet.

The problem was that both approaches were hard. Frequently existing libraries have regular javascript imperative APIs and html in mind. We all know and love how ember makes us flow the data in our app. Previous approaches simply didn't fit where ember really shines: templates, actions, routing, and above all, expressiveness.

Ember-leaflet allows you to express your maps right in your templates. Also, it is streamlined for ember in general. You have things like actions, components and the ability to use regular handlebars helpers like {{#if or {{#each.

We can't go wrong with delegating the mapping part to the battle tested, performant and lightweight Leaflet library.

So, let the mapping begin.

Examples

Think of your map as a set of layers inside a container. Your main container will be the <LeafletMap> component. This component creates the map container where your tiles, vectors and markers will be added to. Let's see an example of how it looks:

<LeafletMap @lat={{this.lat}} @lng={{this.lng}} @zoom={{this.zoom}} as |layers|>

  <layers.tile @url="http://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png" />

  <layers.marker @location={{this.emberConfLocation}} as |marker|>
    <marker.popup>
      <h3>The Oregon Convention Center</h3>
      777 NE Martin Luther King Jr Blvd<br>
      Portland, OR 97232
    </marker.popup>
  </layers.marker>

  <layers.marker @location={{this.hotel}} as |marker|>
    <marker.popup>
      <h3>Hotel</h3>
    </marker.popup>
  </layers.marker>

</LeafletMap>

Linting

  • npm run lint:js
  • npm run lint:js -- --fix

Running tests

  • ember test – Runs the test suite on the current Ember version
  • ember test --server – Runs the test suite in "watch mode"
  • ember try:each – Runs the test suite against multiple Ember versions

Running the dummy application

For more information on using ember-cli, visit https://ember-cli.com/.

Contributing

See the Contributing guide for details.

License

This project is licensed under the MIT License.

  • 最近项目需要用来Ember,又要开始新的学习了,由于网上资料比较少,可以找到的基本都是英文,因此,这里对Ember官方网站的Guide进行边看边翻译,以方便自己深化理解。 英文原址:http://emberjs.com/guides/concepts/core-concepts/ 开始学习Ember,你必须了解下面列举的一些核心概念。 Ember.js的设计目的是帮助开发者创建任意规模的Web应用

 相关资料
  • Leaflet 是领先的用于移动友好交互式地图的开源 JavaScript 库。仅仅重约39KB的JS,它拥有大多数开发者所需要的所有地图功能。 Leaflet在设计时考虑到了简单性、性能和可用性。它可以在所有主要的桌面和移动平台上高效地工作,可以通过大量的插件进行扩展,拥有一个漂亮的、易于使用的、记录良好的API,以及一个简单的、可读的源代码。

  • Leaflet 是一款开源的JavaScript地图库,适用于移动端的交互地图。JS库的大小仅38K,但包含了大部分开发者们所需的所有地图功能。Leaflet可以在所有主流的桌面和移动端平台上高效运行,支持多种插件扩展,并提供了简洁明了的API文档和易读的源代码。 本章节仅包含主要功能开发指南,详细的接口参数请参考 SuperMap iClient for Leaflet 提供的 API 说明。

  • Esir Leaflet 是 esri 为 leaflet 开发的一套组件,功能非常全面,支持常用的 arcgis 查询编辑等功能;可以非常容易地与 arcgis 或者 kcgis 配合使用,发布自己喜欢的地图;继承至 leaflet 的小巧灵活,修改起来也非常容易。 Leaflet 是一个开源的地图 JavaScript 库,它由 Universal Mind 的 Vladimir Agafonkin 创建。

  • 项目介绍: 基于`Leaflet`引擎的`React`地图组件,支持`TypeScript` 由数据驱动地图元素的添加与移除,完整的声明周期控制 支持特性: 支持TypeScript Popup,Tooltip,DivIcon组件支持JSX内容 支持海量点位组件 支持聚合点位组件 支持主题定制 支持按需加载 支持插件: rc-leaflet-drawing 后续规划: LayerGroup,Fea

  • 面试了两个月,发现大大小小的公司无论面试多久,最后必须来两三道手撕题,考验候选人的代码能力 平时简单题手到擒来,但到了面试官面前就大脑宕机 简简单单一道【实现apply】都能卡住,我的总结是还得多练,同一道题多打几次,面试的时候才能思路清晰 整理了最基础的常见手撕,啃下这些,基本可以应对70%的手撕题 当然大厂手撕并不都是简单基础题,很多都是在这13道基础上拓展,先练好这13道基础题,面试的时候就

  • 问题描述:地图和测量插件集成后,新建测量,此时点击地图画点,点会向右下方向偏移(点击位置1 实际打的点会偏移到位置 2) 请给出解决方案(有偿) vue 组件代码 如下 可赋值下来到vue项目中调试 package.json中下载依赖 组件代码 底部样式文件 theme.scss