| | |
| | | import com.dayu.pipirrapp.utils.SharedPreferencesHelper; |
| | | import com.dayu.pipirrapp.utils.ToastUtil; |
| | | import com.dayu.pipirrapp.utils.WebViewUtils; |
| | | import com.dayu.pipirrapp.view.ConfirmDialog; |
| | | import com.jeremyliao.liveeventbus.LiveEventBus; |
| | | |
| | | import java.io.File; |
| | |
| | | LiveEventBus.get(CommonKeyName.locationData).observeForever(new Observer<Object>() { |
| | | @Override |
| | | public void onChanged(Object o) { |
| | | |
| | | LatLonBean latLonBean = (LatLonBean) o; |
| | | mWebView.evaluateJavascript("javascript:locationOverLay(\"" + latLonBean.getLongitude() + "\",\"" + latLonBean.getLatitude() + "\")", value -> { |
| | | Log.i("chageInspecState", "lat:" + latLonBean.getLatitude() + ",log:" + latLonBean.getLongitude()); |
| | | mWebView.evaluateJavascript("javascript:updateLocation(\"" + latLonBean.getLatitude() + "\",\"" + latLonBean.getLongitude() + "\")", value -> { |
| | | }); |
| | | } |
| | | }); |
| | |
| | | * 获取取水口列表 |
| | | */ |
| | | private void getMarkerData() { |
| | | ApiManager.getInstance().requestGetHideLoading(this.getContext(), Constants.BASE_URL + ":8085/project/intake/all", MarkerResult.class, null, new SubscriberListener<BaseResponse<MarkerResult>>() { |
| | | ApiManager.getInstance().requestGetHideLoading(this.getContext(), Constants.BASE_URL + "/project/intake/all", MarkerResult.class, null, new SubscriberListener<BaseResponse<MarkerResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<MarkerResult> t) { |
| | | if (t.isSuccess()) { |
| | |
| | | |
| | | |
| | | void initView() { |
| | | //跳转到指定位置 |
| | | binding.flyBtn.setOnClickListener(v -> { |
| | | mWebView.evaluateJavascript("javascript:locationOverLay(116.399565,39.89432)", value -> { |
| | | }); |
| | | }); |
| | | |
| | | mWebView.setWebViewClient(new WebViewClient() { |
| | | @Override |
| | | public WebResourceResponse shouldInterceptRequest(WebView view, WebResourceRequest request) { |
| | |
| | | }); |
| | | //巡检按钮 |
| | | binding.inspectButton.setOnClickListener(v -> { |
| | | isStartInspec = !isStartInspec; |
| | | chageInspecState(); |
| | | if (isStartInspec) { |
| | | ConfirmDialog confirmDialog = new ConfirmDialog(MapFragment.this.getActivity(), "提示", "确认关闭巡检吗?", new View.OnClickListener() { |
| | | @Override |
| | | public void onClick(View v) { |
| | | isStartInspec = !isStartInspec; |
| | | chageInspecState(); |
| | | } |
| | | }); |
| | | } else { |
| | | isStartInspec = !isStartInspec; |
| | | chageInspecState(); |
| | | } |
| | | |
| | | }); |
| | | } |
| | | |
| | |
| | | */ |
| | | private void getCenterPoint() { |
| | | |
| | | ApiManager.getInstance().requestGet(this.getContext(), Constants.BASE_URL + ":8080/base/dict_item/map_center", CenterPointResult.class, null, new SubscriberListener<BaseResponse<CenterPointResult>>() { |
| | | ApiManager.getInstance().requestGet(this.getContext(), Constants.BASE_URL + "/base/dict_item/map_center", CenterPointResult.class, null, new SubscriberListener<BaseResponse<CenterPointResult>>() { |
| | | @Override |
| | | public void onNext(BaseResponse<CenterPointResult> t) { |
| | | if (t.isSuccess()) { |