open-index/open-npm huggingface dataset:
npm package: @mapgis/mobile-react-native
Description: MapGIS Mobile for React Native，是MapGIS推出的一款基于React-Native的跨平台移动开发框架，用户可以基于它使用JavaScript开发出在Android和iOS平台下运行的原生移动GIS应用。
Author: MapGIS
Latest version: 1.1.4

# MapGIS-Mobile-React-Native-V10.3

MapGIS Mobile for React Native，是MapGIS推出的一款基于React Native的跨平台移动开发框架，用户可以基于它使用JavaScript开发出在Android和iOS平台下运行的原生移动GIS应用。

## 安装

在React Native项目中安装 `@mapgis/mobile-react-native` 包。

```bash
yarn add @mapgis/mobile-react-native@1.1.4
# or with npm
# npm install @mapgis/mobile-react-native@1.1.4
```

### 链接原生库

- **React Native 0.60 and higher**

  [linking is automatic](https://github.com/react-native-community/cli/blob/master/docs/autolinking.md)，不需要执行任何操作。

- **React Native 0.59 and lower**

  如果您使用的是旧版本的React Native，则需要手动链接：

  ```sh
  react-native link @mapgis/mobile-react-native
  ```

## 用法


```js
// In App.js
import React, { Component } from "react";
import { Platform, StyleSheet, View, PermissionsAndroid } from "react-native";
import { Environment, MGMapView } from "@mapgis/mobile-react-native";

export default class App extends Component {
  onGetInstance = mapView => {
    this.mapView = mapView;
    this.openMap();
  };

  openMap = async () => {
    //请求权限
    await requestMultiplePermission();

    //初始化环境目录
    var environmnetModule = new Environment();
    var environmnet = await environmnetModule.createObj();
    await environmnet.initialize("MapGISSample");

    //请求授权
    await environmnet.requestAuthorization();

    //加载文档
    await this.mapView.loadFromFile(
      "MapGISSample/Map/MapShow/WuHan/WuHan.mapx"
    );
  };

  render() {
    return (
      <View style={styles.container}>
        <MGMapView
          ref="mapView"
          onGetInstance={this.onGetInstance}
          style={styles.mapView}
        />
      </View>
    );
  }
}

function checkGranted(granteds) {
  const values = Object.values(granteds);
  let isGranted = true;
  for (let i = 0; i < values.length - 1; i++) {
    if (values[i] != values[i + 1]) {
      isGranted = false;
      break;
    }
  }
  if (isGranted && values[0] === PermissionsAndroid.RESULTS.GRANTED) {
    return true;
  }
  return false;
}

async function requestMultiplePermission() {
  if (Platform.OS === "ios") return;

  try {
    const permissions = [
      PermissionsAndroid.PERMISSIONS.WRITE_EXTERNAL_STORAGE,
      PermissionsAndroid.PERMISSIONS.READ_PHONE_STATE
    ];
    //返回得是对象类型
    const granteds = await PermissionsAndroid.requestMultiple(permissions);
    if (!checkGranted(granteds)) {
      throw new Error("授权拒绝，无法正常使用本应用");
    }
  } catch (err) {
    throw new Error("授权失败，无法正常使用本应用");
  }
}

const styles = StyleSheet.create({
  container: {
    flex: 1
  },
  mapView: {
    flex: 1,
    alignSelf: "stretch"
  }
});
```
npm package: @mapgis/webclient-es6-service
Description: mapgis ES6 format for igserver
Author: Wuhan Zondy Cyber Science&Technology Co.Ltd.
Latest version: 16.2.9

# MapGIS Client for JavaScript - Service

[![npm version][npm-img]][npm-url]
[![apache licensed](https://img.shields.io/badge/license-Apache%202.0-orange.svg?style=flat-square)](https://github.com/MapGIS/WebClient-JavaScript/blob/master/LICENSE)

[npm-img]: https://img.shields.io/badge/npm-10.5.5-brightgreen
[npm-url]: https://www.npmjs.com/package/@mapgis/webclient

MapGIS Client for JavaScript - Service：是增强的MapGIS Web开发平台，集成Fetch、ES6、Promise等现代特性，在传统WebGIS开发基础之上，增强大数据、实时流数据的高效可视化表达和分析，为用户带来全新开发体验。

![框架](assets/logo/framework.png)

[在线文档](http://develop.smaryun.com/docs/mapboxgl/index.html)

## 环境
> 由于core-js2和core-js3的在vue-cli4的不同的前置依赖导致了在vue2的环境下core-js不能把对应的依赖版本加入到package.json中，但是实际上package.json中引用的是core-js3的版本，一旦显示的描述会导致所有引用webclient-vue-ui的库的库都会强行自动升级core-js3，导致整个环境冲突问题。这个问题只能通过升级vue3来解决。
## 目录
针对MapGIS提供的IGServer/IGServer-X/IGServer-S/DataStore/ArcGIS等多种服务进行封装
``` js
{
    Style,
    Crs,
    Common,
    BaseServer,
    // igserver
    Extend,
    G3D,
    MRCS,
    MRFS,
    MRFWS,
    MRGS,
    MRMS,
    Info,
    OGC,
    // datastore
    ElasticSearch,
    PostGIS,
    CloudDisk,
    // arcgis
    ArcGis
}; 
```

## 使用
``` js
import { Style } from "@mapgis/webclient-es6-service";
const { MarkerStyle, LineStyle, PointStyle, FillStyle } = Style;

let layerStyle = new PointStyle({
    radius: 12,
    color: "#ffffff",
    opacity: 0.8,
    outlineWidth: 5,
    outlineColor: "#52B883",
});
```

## 调试
> 默认的引入方式是main
``` json
{
    "main": "dist-libs/webclient-es6-service.min.js",
    "module1": "index.js",
}
```
> 如果需要试试调试请修改成如下:
``` json
{
    "main1": "dist-libs/webclient-es6-service.min.js",
    "module": "index.js",
}
``` 
> 同时安装对应的所需依赖
``` sh
# 使用yarn
yarn 
# 或者使用npm
npm install 
```