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

[Bug]: setConnected is undefined #2908

Closed
jmysliv opened this issue Jun 14, 2023 · 6 comments
Closed

[Bug]: setConnected is undefined #2908

jmysliv opened this issue Jun 14, 2023 · 6 comments
Labels
bug 🪲 Something isn't working error-in-code good first issue Good for newcomers iOS iOS related tickets todo Valid bug, but we don't have time to look into v10

Comments

@jmysliv
Copy link

jmysliv commented Jun 14, 2023

Mapbox Implementation

Mapbox

Mapbox Version

default

Platform

Android

@rnmapbox/maps version

10.0.6

Standalone component to reproduce

import React, { useEffect } from 'react';
import MapboxGL, {
  MapView,
  ShapeSource,
  LineLayer,
  Camera,
} from '@rnmapbox/maps';

const aLine = {
  type: 'LineString',
  coordinates: [
    [-74.00597, 40.71427],
    [-74.00697, 40.71527],
  ],
};

function BugReportExample {
    useEffect(() => {
        MapboxGL.setConnected(false);
    }, []);

    return (
      <MapView style={{flex: 1}}>
        <Camera centerCoordinate={[-74.00597, 40.71427]} zoomLevel={14} />
        <ShapeSource id="idStreetLayer" shape={aLine}>
          <LineLayer id="idStreetLayer" />
        </ShapeSource>
      </MapView>
    );

}

Observed behavior and steps to reproduce

The following error appears:

undefined is not a function

Expected behavior

The function should run without the error.

Notes / preliminary analysis

No response

Additional links and references

No response

@github-actions
Copy link

Lint failed 😭

Please fix the errors in your code example - More info.:


<text>
  18:27  error  Parsing error: Unexpected token {

✖ 1 problem (1 error, 0 warnings)

@mfazekas
Copy link
Contributor

mfazekas commented Jun 15, 2023

We don't have setConnected implemented for v10/android.

We could using OfflineSwitch class:

https://docs.mapbox.com/android/maps/api/10.14.0/mapbox-maps-android/com.mapbox.common/-offline-switch/
https://docs.mapbox.com/ios/maps/api/10.14.0/Classes/OfflineSwitch.html

====
mapbox/mapbox-maps-android#206

There is a changelog entry:

* Introducing NetworkConnectivity API (offline switch). If setting setMapboxStackConnected(false), the Reachability API will report NotReachable, http requests are being blocked and if running, cancelled.

But I don't see anything like that in current version - ah renamed to OfflineSwitch

https://github.com/mapbox/mapbox-maps-android/blob/49397adcd04443fcbd403b8763b56952ce362fbb/app/src/main/java/com/mapbox/maps/testapp/examples/OfflineActivity.kt#L90

@mfazekas mfazekas added bug 🪲 Something isn't working good first issue Good for newcomers iOS iOS related tickets v10 labels Jun 15, 2023
@jmysliv
Copy link
Author

jmysliv commented Jun 20, 2023

@mfazekas thanks for your reply. Do you have in your roadmap to implement it then?

@mateuuszzzzz
Copy link

@mfazekas do you have any update on this problem?

@mfazekas mfazekas added the todo Valid bug, but we don't have time to look into label Dec 9, 2023
@mfazekas
Copy link
Contributor

mfazekas commented Dec 9, 2023

Valid bug, but not planned do to lack of resources. Closing as not planned.

@mfazekas mfazekas closed this as not planned Won't fix, can't repro, duplicate, stale Dec 9, 2023
@made4udhilip
Copy link

OMG, Then have to remove Mapbox offline from the project, RN offline mapbox no more use when its don't have this feature. As it alway create error, Mapbox will search through network for new tiles (online) when user zoom the offline map. we can declare RN Mapbox offline is not supported anymore. People who are trying mapbox offline feature don't waste time here, its no more supported as mentioned by @mfazekas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug 🪲 Something isn't working error-in-code good first issue Good for newcomers iOS iOS related tickets todo Valid bug, but we don't have time to look into v10
Projects
None yet
Development

No branches or pull requests

4 participants