管灌系统巡查员智能手机App
zuoxiao
2024-11-28 fbfa859ff0fe312cbb49a3345b6e3d67d574a946
app/src/main/java/com/dayu/pipirrapp/fragment/MapFragment.java
@@ -106,8 +106,10 @@
            LiveEventBus.get(CommonKeyName.locationData).observeForever(new Observer<Object>() {
                @Override
                public void onChanged(Object o) {
                    LatLonBean latLonBean = (LatLonBean) o;
                    mWebView.evaluateJavascript("javascript:updateLocation(\"" +  latLonBean.getLatitude()+ "\",\"" +  latLonBean.getLongitude()+ "\")", value -> {
                    Log.i("chageInspecState", "lat:" + latLonBean.getLatitude() + ",log:" + latLonBean.getLongitude());
                    mWebView.evaluateJavascript("javascript:updateLocation(\"" + latLonBean.getLatitude() + "\",\"" + latLonBean.getLongitude() + "\")", value -> {
                    });
                }
            });
@@ -200,7 +202,7 @@
     * 获取取水口列表
     */
    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()) {
@@ -284,11 +286,7 @@
    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) {
@@ -346,15 +344,15 @@
        });
        //巡检按钮
        binding.inspectButton.setOnClickListener(v -> {
            if (isStartInspec){
                ConfirmDialog confirmDialog=new ConfirmDialog(MapFragment.this.getActivity(), "提示", "确认关闭巡检吗?", new View.OnClickListener() {
            if (isStartInspec) {
                ConfirmDialog confirmDialog = new ConfirmDialog(MapFragment.this.getActivity(), "提示", "确认关闭巡检吗?", new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        isStartInspec = !isStartInspec;
                        chageInspecState();
                    }
                });
            }else {
            } else {
                isStartInspec = !isStartInspec;
                chageInspecState();
            }
@@ -374,7 +372,7 @@
     */
    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()) {