UNPKG

rn_supermap

Version:

rn_supermap 一款基于React-Native框架的移动应用开发工具。基于该开发工具,用户可以使用JavaScript开发语言,开发出在Android和IOS操作系统下运行的原生移动GIS应用,入门门槛低,一次开发,处处运行。

67 lines (58 loc) 1.58 kB
/********************************************************************************* Copyright © SuperMap. All rights reserved. Author: Yang Shanglong E-mail: yangshanglong@supermap.com Description: 工作空间操作类 **********************************************************************************/ import { NativeModules, DeviceEventEmitter, NativeEventEmitter, Platform, PixelRatio } from 'react-native' import * as MapTool from './SMapTool' import * as MapSettings from './SMapSettings' import * as LayerManager from './SLayerManager' import * as Plot from './SPlot' import * as Datasource from './SDatasource' import { EventConst } from '../../constains/index' const dpi = PixelRatio.get() // let SMapSuspension = NativeModules.SMapSuspension // const nativeEvt = new NativeEventEmitter(SMapSuspension) export default (function () { /** * 打开指定mapview * @returns {*} */ function openMap (mapid) { try { return SMapSuspension.openMap(mapid) } catch (e) { console.error(e) } } /** * 打开地图 * @returns {*} */ function openMapByName (strMapName, params = {}) { try { return SMapSuspension.openMapByName(strMapName, params) } catch (e) { console.error(e) } } /** * 关闭地图 * @returns {*} */ function closeMap () { try { return SMapSuspension.closeMap() } catch (e) { console.error(e) } } let SMapSuspensionExp = { openMap, openMapByName, closeMap, } Object.assign(SMapSuspensionExp) return SMapSuspensionExp })()