Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

调用高德手机客户端 #22

Closed
tongliwei123 opened this issue May 25, 2017 · 3 comments
Closed

调用高德手机客户端 #22

tongliwei123 opened this issue May 25, 2017 · 3 comments

Comments

@tongliwei123
Copy link

您好,我不知道怎么在咱们的插件中使用调用高德客户端的方法,您能指导一下么

@ioslh
Copy link
Collaborator

ioslh commented May 26, 2017

你好,高德地图提供了接口,可以在不同的实例中都可以调起高德地图客户端;
比如:点击地图,点击标记点,位置搜索等等;请问你需求是在什么操作后调起客户端?

以地图为例,假如需求是点击地图后调起客户端的代码示例:

const map = null;
const amapEvents = {
      created(m) {
        map = m;
      },
      click(e) {
        if (map) {
         map.poiOnAMAP({
            id: 'B000A7BD6C',
            location: e.lnglat
          })
        }
      }
};

/* JSX */
<Map zoom={8} events={amapEvents}>

上述代码中用到的poiOnAMAP方法在 Map 类的高德官方文档中有说明

另外,JavaScript API在Marker、Map、PlaceSearch、Driving、Transfer、Walking这些类中提供了调起高德地图的方法,参考这些类相应的高德文档。

希望能帮到你。

@tongliwei123
Copy link
Author

tongliwei123 commented May 27, 2017 via email

@ioslh
Copy link
Collaborator

ioslh commented May 27, 2017

有什么疑问或者建议欢迎继续回复

@ioslh ioslh closed this as completed Jun 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants