1 Star 0 Fork 10

李屹然 / TinyMap For HarmonyOS

forked from 董昱 / TinyMap For HarmonyOS 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.en.md 2.22 KB
一键复制 编辑 原始数据 按行查看 历史
董昱 提交于 2020-12-19 10:28 . add tiny map basic feature

TinyMap For HarmonyOS

Description

Easy-to-use lightweight map component for HarmonyOS

Advantages:

  1. Super lightweight, currently only contains three classes, suitable for source code research and learning.
  2. Gaude map and Google map can be used as geographic base map, and satellite image and vector base map data can be selected.
  3. Add custom base map elements (elements)

Installation

Move the tinymap module (HAP) to the required project, and import the project into the module (HAP) to be called. Insert the following code in build.gradle:

apply plugin: 'com.huawei.ohos.hap'
...

dependencies {
    ...
    implementation project(':tinymap')
}

Instructions

At present, it supports the sliding and translation of gestures, but does not support the zooming in and zooming out of the gestures (this function will be added later).

  1. zoomIn() method: zoom in the map
  2. zoomOut() method: zoomout the map
  3. RefreshMap() method: refresh the map
  4. setMapSource(TinyMap.MapSource MapSource) method: switch the base map data source. At present, there are five types of base map data sources

MapSource.GAODE_ROAD : Gaode Road data MapSource.GAODE_VECTOR : Gaode vector data MapSource.GAODE_SATELLITE : Gaode satellite data MapSource.GOOGLE_VECTOR : Google vector data MapSource.GOOGLE_SATELLITE : Google satellite data

  1. Addelement (float x, float y, int resource) method: add base map elements (at present, only Mercator projection coordinates are supported, and latitude and longitude coordinate methods will be added later). For example:

addElement(12956517.35f, 4864667.87f, ResourceTable.Media_ dot)

Contribution

  1. Fork the repository
  2. Create Feat_xxx branch
  3. Commit your code
  4. Create Pull Request

Gitee Feature

  1. You can use Readme_XXX.md to support different languages, such as Readme_en.md, Readme_zh.md
  2. Gitee blog blog.gitee.com
  3. Explore open source project https://gitee.com/explore
  4. The most valuable open source project GVP
  5. The manual of Gitee https://gitee.com/help
  6. The most popular members https://gitee.com/gitee-stars/
Java
1
https://gitee.com/lyr97/tiny-map-for-harmony-os.git
git@gitee.com:lyr97/tiny-map-for-harmony-os.git
lyr97
tiny-map-for-harmony-os
TinyMap For HarmonyOS
master

搜索帮助