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

AMap.PlaceSearch搜索不到自定义的点标记 Marker #258

Open
3 tasks done
yichenw7 opened this issue Jan 18, 2022 · 1 comment
Open
3 tasks done

AMap.PlaceSearch搜索不到自定义的点标记 Marker #258

yichenw7 opened this issue Jan 18, 2022 · 1 comment

Comments

@yichenw7
Copy link

yichenw7 commented Jan 18, 2022

  • 我已经搜索过 issue,没有类似的问题,或者类似的问题仍然没有解决方案。
    没有搜到相关

  • 我已经搜索过文档,并且仍然没有找到解决方案。
    没有搜到相关

  • 我写了个问题重现的例子,链接或者代码将会贴在下面。
    window.AMap.plugin('AMap.PlaceSearch', () => {
    placeSearch = new window.AMap.PlaceSearch({
    input: 'tipinput',
    pageSize: 10,
    pageIndex: 1,
    citylimit: false
    // citylimit: true // 仅搜索本城市的地名
    });

        function select(e) {
          placeSearch.setCity(e.poi.adcode);
          placeSearch.search(e.poi.name); // 关键字查询查询
        }
        placeSearch.on('select', select); // 注册监听,当选中某条记录时会触发
      });
    

const randomMarker = (len) =>
Array(len)
.fill(true)
.map((e, idx) => ({
position: {
longitude: 100 + Math.random() * 30,
latitude: 30 + Math.random() * 20
},
myLabel: 债券${alphabet[idx]},
myIndex: idx + 1,
title: 债券${alphabet[idx]},
address: 债券${alphabet[idx]},
name: 债券${alphabet[idx]},
district: 债券${alphabet[idx]}
}));
this.markers = randomMarker(10);

Reproduce Example Link or Code Fragment

What is Expected?

What is actually happening?

@yichenw7
Copy link
Author

勾选

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

1 participant