Skip to content

Commit

Permalink
Merge pull request #91 from shine2008/master
Browse files Browse the repository at this point in the history
feat(locationkit):更新定位功能
  • Loading branch information
shine2008 authored Dec 16, 2022
2 parents 329b3e1 + 4433279 commit 76ad3b7
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
2 changes: 1 addition & 1 deletion app/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ dependencies {
implementation("com.netease.yunxin.kit.team:teamkit-ui:9.3.0-rc01")
implementation("com.netease.yunxin.kit.chat:chatkit-ui:9.3.0-rc01")
implementation("com.netease.yunxin.kit.search:searchkit-ui:9.3.0-rc01")
implementation("com.netease.yunxin.kit.locationkit:locationkit:1.0.0-rc03")
implementation("com.netease.yunxin.kit.locationkit:locationkit:1.0.0-rc04")
implementation("com.airbnb.android:lottie:5.0.3")
implementation("com.github.bumptech.glide:glide:4.13.1")
implementation("com.squareup.retrofit2:retrofit:2.9.0")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -281,10 +281,12 @@ private void onMakerChange(LatLng latLng, int markerId, boolean center) {
if (center) {
options.anchor(0.5f, 0.5f);
}
clearMarker();
clearMarker();
markLatLng = latLng;
Marker marker = chatMapWrapper.aMap.addMarker(options);
addMarkerList.add(marker);
if (!center) {
addMarkerList.add(marker);
}
}

private void clearMarker() {
Expand All @@ -306,8 +308,14 @@ public void onPoiSearched(PoiResult poiResult, int code) {
// 缓存定位地址列表
locationPoiCache = convert(poiResult.getPois(), false);
// 添加定位地址
currentLocation.setSelected(true);
locationPoiCache.add(0, currentLocation);
if (currentLocation != null) {
currentLocation.setSelected(true);
locationPoiCache.add(0, currentLocation);
}else {
if (locationPoiCache.size() > 0){
locationPoiCache.get(0).setSelected(true);
}
}
ALog.i(TAG, "onPoiSearched locationPoiResult:" + locationPoiCache);
searchCallback.onSuccess(locationPoiCache);
return;
Expand Down

0 comments on commit 76ad3b7

Please sign in to comment.