Giter Site home page Giter Site logo

hwyx / leaflet4android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from sunflo/leaflet4android

0.0 0.0 0.0 464 KB

leaflet 引擎的android端封装实现,用于加载常见格式的栅格瓦片,或者用于覆盖手机端非3857瓦片加载的应用场景

License: Apache License 2.0

JavaScript 74.65% Kotlin 15.99% CSS 4.53% HTML 4.83%

leaflet4android's Introduction

LeafletDroid

Leaflet SDK for android platform

leaflet 引擎的android端封装实现,用于加载常见格式的栅格瓦片

实现了:

  • 坐标原点及切片分辨率的自定义
  • 坐标投影类型的自定义
  • 支持常见栅格瓦片如WMS,WMTS,TMS,ARCGIS等
  • 支持基础的地图功能操作,如Marker绘制,点线面绘制,视角切换,事件回调,热力图等功能
  • 功能逐步增加中

如何使用(可参考项目app模块的demo应用)

将项目中的lib模块导入项目依赖
implementation project(path: ':lib')
在页面新建创建MapView布局
<com.flo.leaflet.sdk.lib.MapView
    android:id="@+id/mapview"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    app:layout_constraintBottom_toBottomOf="parent"
    app:layout_constraintEnd_toEndOf="parent"
    app:layout_constraintStart_toStartOf="parent"
    app:layout_constraintTop_toTopOf="parent" />
通过getMapAsync方法获取LeafletMap实例
mapView.getMapAsync(object : OnMapReadyListener {
    override fun mapReady(map: LeafletMap) {
    }
}
通过 map.addLayer方法添加瓦片图层
map.addLayer(
    TMSTile(
        "http://t2.tianditu.gov.cn/DataServer?T=vec_c&x={x}&y={y}&l={z}&tk=256f647aaffe22c1da0f4c0cae2dd806",
        id = "bg"
    )
)

leaflet4android's People

Contributors

sunflo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.