Skip to content
This repository was archived by the owner on Aug 8, 2023. It is now read-only.
This repository was archived by the owner on Aug 8, 2023. It is now read-only.

Marker is dragging, and map is not moving. #9661

Closed

Description

@samvmisti

Platform:
Android
Mapbox SDK version:
com.mapbox.mapboxsdk:mapbox-android-sdk:5.1.1@aar

Steps to trigger behavior

  1. Run app for the first time
@Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle 
    savedInstanceState) {
        View view = super.onCreateView(inflater, container, savedInstanceState);
        if (savedInstanceState == null) {
            mapFragment = SupportMapFragment.newInstance(new MapboxMapOptions()
                    .styleUrl(Style.DARK)
                    .compassEnabled(false)
                    .locationEnabled(false));
            FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
            transaction.add(getContainerId(), mapFragment, "com.mapbox.map");
            transaction.commit();
        } else {
            mapFragment = (SupportMapFragment) 
       activity.getSupportFragmentManager().findFragmentByTag("com.mapbox.map");
        }
        return view;
    }
  1. mapfragment is inside my fragment

Expected behavior

map is moving, marker in the centre

Actual behavior

map is not moving, marker is moving with finger

Activity

  1. changed the title [-]Marked is dragging map is not moving[/-] [+]Marker is dragging map is not moving[/+] on Aug 1, 2017
  2. changed the title [-]Marker is dragging map is not moving[/-] [+]Marker is dragging, and map is not moving.[/+] on Aug 1, 2017
  3. samvmisti commented on Aug 1, 2017

    @samvmisti
    Author

    screenshot_2017-08-01-14-41-56-363_com android settings 1
    My device.

  4. added
    Android
    on Aug 1, 2017
  5. tobrun commented on Aug 1, 2017

    @tobrun
    Member

    Thank you for the report, this seems similar to #9459. a couple of follow up questions: since you are adding a fragment inside another fragment, why not use a ChildFragmentManager? Are you having this issue on other devices? Are you experiencing the same issue with https://play.google.com/store/apps/details?id=com.mapbox.mapboxandroiddemo?

  6. samvmisti commented on Aug 1, 2017

    @samvmisti
    Author
    • Ok, I'll try to use ChildFragmentManager.
    • I have this issue also on nexus 5x, samsung s5
    • there is no location marker in that app
  7. tobrun commented on Aug 2, 2017

    @tobrun
    Member

    Would you be able to show the full code of that fragment?

  8. samvmisti commented on Aug 2, 2017

    @samvmisti
    Author

    Using

    getChildFragmentManager()
                        .beginTransaction()
                        .add(getContainerId(), mapFragment, "com.mapbox.map")
                        .commit();
    

    Instead of

    FragmentTransaction transaction = activity.getSupportFragmentManager().beginTransaction();
                transaction.add(getContainerId(), mapFragment, "com.mapbox.map");
                transaction.commit();
    

    Fixed my problem. Thank you very much for the advice.

  9. tobrun commented on Aug 2, 2017

    @tobrun
    Member

    Thank you for reporting that back!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Android

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions