Skip to content

Instantly share code, notes, and snippets.

@phektus
Last active August 29, 2015 14:02
Show Gist options
  • Save phektus/99a48aacddd28f6fab73 to your computer and use it in GitHub Desktop.
Save phektus/99a48aacddd28f6fab73 to your computer and use it in GitHub Desktop.
HomeGridFragment

centerMapOntoLocation

Branch: arbie-compile

    public void centerMapOntoLocation(LatLng centerGeoPoint)
    {
        MapsInitializer.initialize(this.getActivity());
        mMap.clear();
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(centerGeoPoint, 14));

        mMap.addMarker(new MarkerOptions()
                .position(centerGeoPoint)
                .title(getString(R.string.map_selected))
                .draggable(true)
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_normal)));
    }

Branch: master

    public void centerMapOntoLocation(LatLng centerGeoPoint)
    {
        MapsInitializer.initialize(this.getActivity());
        mMap.clear();
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(centerGeoPoint, 14));

        mMap.addMarker(new MarkerOptions()
                .position(centerGeoPoint)
                .title(getString(R.string.map_selected))
                .draggable(true)
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_normal)));
    }

Branch: 4b5b35c15bddacb246d3ea525c16daed6387f7be (Logs for [BUG-MP-6])

    public void centerMapOntoLocation(LatLng centerGeoPoint)
    {
        MapsInitializer.initialize(this.getActivity());
        mMap.clear();
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(centerGeoPoint, 14));

        mMap.addMarker(new MarkerOptions()
                .position(centerGeoPoint)
                .title(getString(R.string.map_selected))
                .draggable(true)
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_normal)));
    }

Branch: 82804a58b821b78b8fd1163ab13efc533c483876 (Fix [BUG-SL2-72] and update solution [BUG-SU8-61])

    public void centerMapOntoLocation(LatLng centerGeoPoint)
    {
        MapsInitializer.initialize(this.getActivity());
        mMap.clear();
        mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(centerGeoPoint, 14));

        mMap.addMarker(new MarkerOptions()
                .position(centerGeoPoint)
                .title(getString(R.string.map_selected))
                .draggable(true)
                .icon(BitmapDescriptorFactory.fromResource(R.drawable.marker_normal)));
    }

mapUser

Branch: arbie-compile

    private void mapUser() {
        if (currentUser != null && currentUser.getLocation() != null) {
            // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
            MapsInitializer.initialize(this.getActivity());

            String myCoordinates[] = {currentUser.getLocation().split(",")[0], currentUser.getLocation().split(",")[1].replace(",", "")};
            LatLng myPoint = new LatLng(Double.parseDouble(myCoordinates[0]), Double.parseDouble(myCoordinates[1]));
            mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myPoint, 14));
        }
    }

Branch: master

    private void mapUser() {
        if (currentUser != null && currentUser.getLocation() != null) {
            // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
            MapsInitializer.initialize(this.getActivity());

            String myCoordinates[] = {currentUser.getLocation().split(",")[0], currentUser.getLocation().split(",")[1].replace(",", "")};
            LatLng myPoint = new LatLng(Double.parseDouble(myCoordinates[0]), Double.parseDouble(myCoordinates[1]));
            mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myPoint, 14));
        }
    }

Branch: 4b5b35c15bddacb246d3ea525c16daed6387f7be (Logs for [BUG-MP-6])

    private void mapUser() {
        if (currentUser != null && currentUser.getLocation() != null) {
            // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
            MapsInitializer.initialize(this.getActivity());

            String myCoordinates[] = {currentUser.getLocation().split(",")[0], currentUser.getLocation().split(",")[1].replace(",", "")};
            LatLng myPoint = new LatLng(Double.parseDouble(myCoordinates[0]), Double.parseDouble(myCoordinates[1]));
            mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myPoint, 14));
        }
    }

Branch: 82804a58b821b78b8fd1163ab13efc533c483876 (Fix [BUG-SL2-72] and update solution [BUG-SU8-61])

    private void mapUser() {
        if (currentUser != null && currentUser.getLocation() != null) {
            // Needs to call MapsInitializer before doing any CameraUpdateFactory calls
            MapsInitializer.initialize(this.getActivity());

            String myCoordinates[] = {currentUser.getLocation().split(",")[0], currentUser.getLocation().split(",")[1].replace(",", "")};
            LatLng myPoint = new LatLng(Double.parseDouble(myCoordinates[0]), Double.parseDouble(myCoordinates[1]));
            mMap.animateCamera(CameraUpdateFactory.newLatLngZoom(myPoint, 14));
        }
    }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment