首页 / 浏览问题 / 三维GIS / 问题详情
超图搜索功能
72EXP 2022年06月24日

超图页面中搜索输入关键词提示列表这个功能是否有???

就是这个展示列表功能:

1个回答

您好,构造地址匹配服务,构造您业务数据的是可以实现该能力的。

https://blog.csdn.net/supermapsupport/article/details/77933357

或者也可以使用Oline产品线已经构造好的地址匹配服务。

希望可以帮助到您。

9,343EXP 2022年06月24日
使用对应的iclient产品来初始化地址匹配服务就可以的。

上面回答里给您提供的csdn和demo都很清晰具体的实现了的。

我使用这个 AddressMatchService 为什么会报错呢??

   // var  addressUrl = "http://localhost:8090/iserver/services/addressmatch-Address/restjsr/v1/address/geocoding.rjson?address=公司&fromIndex=0&toIndex=10&maxReturn=-1";
      var host = window.isLocal ? window.server : "https://iserver.supermap.io";

      var addressUrls=host+'/iserver/services/addressmatch-Address/restjsr/v1/address/geocoding.rjson?address=公司&fromIndex=0&toIndex=10&maxReturn=-1'
      var addressMatchService = new SuperMap.REST.AddressMatchService(addressUrls,{data: '11'});
      console.log(addressMatchService,'addressMatchService22');

该报错有三个可能,引包错误、构造错误、参数错误,建议您先排查引包错误。

还有就是上面给您提供的是11的iclient,如果您用的是10i升级成11i或者请移步这里 http://support.supermap.com.cn:8090/iserver/iClient/forJavaScript/web/index.html
这个react版本我也不知道是多少版本的呀

报这个错误和版本更新有关系是吗??

TypeError: SuperMap is not a constructor
不是 react 版本,是iclient的版本,iclient不同版本示例代码和引包是有一些差异的。

你的iclient是10i,示例代码就看10i,是11i就看11i的。

TypeError: SuperMap is not a constructor 有三个可能,引包错误、构造错误、参数错误,建议您先排查引包错误。

不是一定是版本原因哈。
...