add some tests for amap

This commit is contained in:
卞中杰 2019-01-11 15:09:43 +08:00
parent 97b1f780d1
commit aa1bbcfd3a
3 changed files with 22 additions and 4 deletions

View File

@ -1,4 +1,22 @@
const map = new AMap.Map('id', {
const aMap = new AMap.Map('id', {
resizeEnable: true,
animateEnable: true
});
aMap.setCenter(new AMap.LngLat(0, 0));
AMap.plugin(['someplugin'], () => {
console.log('plugin loaded');
});
AMap.convertFrom([116.3, 39.9], 'gps', (status, result) => {
if (result.info === 'ok') {
const _ = result.locations;
}
});
new AMap.Marker({
map: aMap,
title: '',
position: new AMap.LngLat(0, 0),
});

View File

@ -1,4 +1,4 @@
// Type definitions for amap-js-sdk x.x
// Type definitions for amap-js-sdk 1.4.12
// Project: http://lbs.amap.com/api/javascript-api/summary/
// Definitions by: Bian Zhongjie <https://github.com/agasbzj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@ -889,7 +889,7 @@ declare namespace AMap {
/**
*
*/
function convertFrom(lnglat: LngLat | LngLat[], type: string, result: (status: string, result: ConvertorResult) => void): void;
function convertFrom(lnglat: LngLat | LngLat[] | [number, number], type: string, result: (status: string, result: ConvertorResult) => void): void;
interface CitySearchResult {
city: string;

View File

@ -1,4 +1,4 @@
// Type definitions for wx-js-sdk 1.2
// Type definitions for wx-js-sdk 1.4
// Project: https://mp.weixin.qq.com/wiki?t=resource/res_main&id=mp1421141115
// Definitions by: Bian Zhongjie <https://github.com/agasbzj>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped