UNPKG

wilddog-location

Version:

基于Wilddog的地理位置范围查询

45 lines (30 loc) 1.17 kB
# Wilddog Realtime Location Javascript 客户端 ## 简介 Realtime Location 将定位信息向云端实时同步,为你提供地理位置的同步、分发、存储、计算服务。 ## API 文档 https://docs.wilddog.com/location/Web/index.html ## node 版使用说明 ### wilddog 注册 Realtime Location 服务 wilddog 并不直接提供 Realtime Location 功能,需要进行以下操作: **安装依赖** npm install wilddog wilddog-location **注册 Realtime Location 服务** ```js var wilddog = require('wilddog'); var RealtimeLocation = require('wilddog-video'); wilddog.regService('location', function(app) { if (app === null) { throw new Error('application not initialized!Please call wilddog.initializeApp first'); return; }; return new RealtimeLocation(app); }); wilddog.Location = RealtimeLocation; ``` **在 html 中引用高德 api** ```html <script src="http://webapi.amap.com/maps?v=1.3&key=<AMapKey>"></script> ``` 引入高德定位 SDK 的时候,需要填入你高德应用的 AMapKey。如果没有,请在[高德开放平台](http://lbs.amap.com/)中获取。 **开发** 详细内容请参考API文档。