Java Code Examples for com.google.android.gms.maps.model.Marker#setFlat()

The following examples show how to use com.google.android.gms.maps.model.Marker#setFlat() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void setAiLineMarkByHistory(List<X8AiLinePointLatlngInfo> points, int mapTpye) {
    for (X8AiLinePointLatlngInfo point : points) {
        int res;
        MapPointLatLng mp = new MapPointLatLng();
        if (point.getYawMode() == 0) {
            res = R.drawable.x8_ai_line_point_no_angle2;
        } else {
            res = R.drawable.x8_ai_line_point_with_angle1;
        }
        BitmapDescriptor mBitmapDescriptor = this.gdCustemMarkerView.createCustomMarkerView2(this.context, res, this.mMarkerList.size() + 1);
        mp.altitude = (float) point.getAltitude();
        mp.nPos = this.mMarkerList.size() + 1;
        LatLng latLng = new LatLng(point.getLatitude(), point.getLongitude());
        Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng).icon(mBitmapDescriptor).anchor(0.5f, 0.5f).draggable(false));
        mp.longitude = latLng.longitude;
        mp.latitude = latLng.latitude;
        mMarker.setFlat(true);
        mMarker.setTag(mp);
        this.mMarkerList.add(mMarker);
        mp.distance = 0.0f;
        this.mMapPointList.add(mp);
    }
    if (points.size() > 0) {
        drawPointLine(this.gglMapLocationManager.getDevLocation());
    }
}
 
Example 2
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void addSmallMakerByMap1(Marker marker1, Marker marker2) {
    MapPointLatLng mpl1 = (MapPointLatLng) marker1.getTag();
    MapPointLatLng mpl2 = (MapPointLatLng) marker2.getTag();
    LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(marker1.getPosition(), marker2.getPosition(), 3);
    mpl2.setAngle(getPointAngle(mpl1, mpl2));
    mpl2.yawMode = this.lineMarkerSelectListener.getOration();
    float[] angleArray = new float[]{mpl2.showAngle, mpl2.showAngle};
    for (int i = 0; i < latLng.length; i++) {
        MapPointLatLng mpl = new MapPointLatLng();
        mpl.isSelect = true;
        mpl.setAngle(angleArray[i]);
        Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
        mMarker.setTag(mpl);
        mMarker.setFlat(true);
        this.arrowMarkerList.add(mMarker);
    }
}
 
Example 3
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void addSmallMaker(Marker marker1, Marker marker2) {
    MapPointLatLng mpl1 = (MapPointLatLng) marker1.getTag();
    MapPointLatLng mpl2 = (MapPointLatLng) marker2.getTag();
    if (mpl1.yawMode != 0) {
        LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(marker1.getPosition(), marker2.getPosition(), 3);
        float[] angleArray = new float[2];
        if (mpl1.yawMode == 2) {
            mpl2.showAngle = getPointAngle(mpl1, mpl2);
            angleArray[0] = mpl2.showAngle;
            angleArray[1] = mpl2.showAngle;
        } else if (mpl1.yawMode == 1) {
            angleArray = this.mapCalcAngle.getAnlgesByRoration(mpl1.showAngle, mpl2.showAngle, mpl2.roration);
        }
        for (int i = 0; i < latLng.length; i++) {
            MapPointLatLng mpl = new MapPointLatLng();
            mpl.isSelect = true;
            mpl.setAngle(angleArray[i]);
            Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
            mMarker.setTag(mpl);
            mMarker.setFlat(true);
            this.arrowMarkerList.add(mMarker);
        }
    }
}
 
Example 4
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void addOrUpdateSmallMarkerForVideo(int type) {
    clearAllSmallMarker();
    int j = 0;
    for (Marker marker : this.mMarkerList) {
        MapPointLatLng p = (MapPointLatLng) marker.getTag();
        if (j != 0) {
            MapPointLatLng mpl2 = (MapPointLatLng) ((Marker) this.mMarkerList.get(j)).getTag();
            LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(((Marker) this.mMarkerList.get(j - 1)).getPosition(), ((Marker) this.mMarkerList.get(j)).getPosition(), 3);
            float[] angleArray = new float[]{mpl2.showAngle, mpl2.showAngle};
            for (int i = 0; i < latLng.length; i++) {
                MapPointLatLng mpl = new MapPointLatLng();
                mpl.isSelect = true;
                mpl.setAngle(angleArray[i]);
                Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
                mMarker.setTag(mpl);
                mMarker.setFlat(true);
                this.arrowMarkerList.add(mMarker);
            }
        }
        j++;
    }
}
 
Example 5
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public void resetSmallMakerByMap(Marker marker1, Marker marker2, int n) {
    MapPointLatLng mpl1 = (MapPointLatLng) marker1.getTag();
    MapPointLatLng mpl2 = (MapPointLatLng) marker2.getTag();
    LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(marker1.getPosition(), marker2.getPosition(), 3);
    mpl2.setAngle(getPointAngle(mpl1, mpl2));
    float[] angleArray = new float[]{mpl2.showAngle, mpl2.showAngle};
    for (int i = 0; i < latLng.length; i++) {
        MapPointLatLng mpl = new MapPointLatLng();
        mpl.isSelect = true;
        mpl.setAngle(angleArray[i]);
        Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
        mMarker.setTag(mpl);
        mMarker.setFlat(true);
        this.arrowMarkerList.add(n + i, mMarker);
    }
}
 
Example 6
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public Marker addPointMarker(boolean isMapPoint, LatLng latLng, MapPointLatLng mpl, float h, float angle) {
    BitmapDescriptor mBitmapDescriptor;
    float anchorY;
    if (isMapPoint) {
        mBitmapDescriptor = this.gdCustemMarkerView.createMapPointNoAngleNoPioView(this.context, R.drawable.x8_ai_line_point_no_angle1, h, mpl.nPos, mpl.isSelect, false);
        mpl.altitude = h;
        mpl.isMapPoint = isMapPoint;
        anchorY = 0.64285713f;
        int res = 0;
    } else {
        mpl.angle = angle;
        mpl.showAngle = angle;
        mBitmapDescriptor = this.gdCustemMarkerView.createMapPointAngleNoPioView(this.context, R.drawable.x8_ai_line_point_with_angle1, mpl.altitude, mpl.nPos, mpl.showAngle, mpl.isSelect, false);
        mpl.altitude = h;
        mpl.isMapPoint = isMapPoint;
        anchorY = 0.5f;
    }
    Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng).icon(mBitmapDescriptor).anchor(0.5f, anchorY).draggable(false));
    mMarker.setFlat(true);
    return mMarker;
}
 
Example 7
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 6 votes vote down vote up
public Marker addPointMarkerByHistory(MapPointLatLng mpl) {
    BitmapDescriptor mBitmapDescriptor;
    float anchorY;
    if (this.lineMarkerSelectListener.getOration() != 0) {
        mBitmapDescriptor = this.gdCustemMarkerView.createMapPointAngleNoPioView(this.context, R.drawable.x8_ai_line_point_with_angle1, mpl.altitude, mpl.nPos, mpl.showAngle, mpl.isSelect, false);
        anchorY = 0.64285713f;
    } else if (mpl.mInrertestPoint != null) {
        mpl.setAngle(getPointAngle(mpl, mpl.mInrertestPoint));
        mBitmapDescriptor = this.gdCustemMarkerView.createMapPointAngleNoPioView(this.context, R.drawable.x8_ai_line_point_with_angle1, mpl.altitude, mpl.nPos, mpl.showAngle, mpl.isSelect, false);
        anchorY = 0.64285713f;
    } else {
        mBitmapDescriptor = this.gdCustemMarkerView.createMapPointNoAngleNoPioView(this.context, R.drawable.x8_ai_line_point_no_angle1, mpl.altitude, mpl.nPos, mpl.isSelect, false);
        anchorY = 0.64285713f;
    }
    Marker marker = this.googleMap.addMarker(new MarkerOptions().position(new LatLng(mpl.latitude, mpl.longitude)).icon(mBitmapDescriptor).anchor(0.5f, anchorY).draggable(false));
    marker.setFlat(true);
    return marker;
}
 
Example 8
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 5 votes vote down vote up
public void addSmallMakerByMap(Marker marker1, Marker marker2) {
    MapPointLatLng mpl2 = (MapPointLatLng) marker2.getTag();
    LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(marker1.getPosition(), marker2.getPosition(), 3);
    float[] angleArray = new float[]{mpl2.showAngle, mpl2.showAngle};
    for (int i = 0; i < latLng.length; i++) {
        MapPointLatLng mpl = new MapPointLatLng();
        mpl.isSelect = true;
        mpl.setAngle(angleArray[i]);
        Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
        mMarker.setTag(mpl);
        mMarker.setFlat(true);
        this.arrowMarkerList.add(mMarker);
    }
}
 
Example 9
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 5 votes vote down vote up
public void addSmallMarkerByInterest() {
    clearAllSmallMarker();
    int j = 0;
    for (Marker marker : this.mMarkerList) {
        if (j > 0) {
            MapPointLatLng mpl1 = (MapPointLatLng) ((Marker) this.mMarkerList.get(j - 1)).getTag();
            MapPointLatLng mpl2 = (MapPointLatLng) ((Marker) this.mMarkerList.get(j)).getTag();
            if (mpl2.mInrertestPoint != null) {
                LatLng[] latLng = this.mapCalcAngle.getLineLatLngInterval(((Marker) this.mMarkerList.get(j - 1)).getPosition(), ((Marker) this.mMarkerList.get(j)).getPosition(), 3);
                float[] angleArray = new float[2];
                if (mpl1.mInrertestPoint == null) {
                    angleArray[0] = mpl2.showAngle;
                    angleArray[1] = mpl2.showAngle;
                } else {
                    angleArray = this.mapCalcAngle.getAnlgesByRoration(mpl1.showAngle, mpl2.showAngle, 0);
                }
                for (int i = 0; i < latLng.length; i++) {
                    MapPointLatLng mpl = new MapPointLatLng();
                    mpl.isSelect = true;
                    mpl.setAngle(angleArray[i]);
                    Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng[i]).icon(this.gdCustemMarkerView.createPointWithSmallArrow(this.context, R.drawable.x8_ai_line_point_small1, mpl.showAngle, true)).anchor(0.5f, 0.5f).draggable(false));
                    mMarker.setTag(mpl);
                    mMarker.setFlat(true);
                    this.arrowMarkerList.add(mMarker);
                }
            }
        }
        j++;
    }
}
 
Example 10
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 5 votes vote down vote up
public Marker addInterestMarkerByHistory(MapPointLatLng mpl) {
    int res;
    if (mpl.isSelect) {
        res = R.drawable.x8_img_ai_line_inreterst_max2;
    } else {
        res = R.drawable.x8_img_ai_line_inreterst_max1;
    }
    Marker interestMarker = this.googleMap.addMarker(new MarkerOptions().position(new LatLng(mpl.latitude, mpl.longitude)).icon(this.gdCustemMarkerView.createMapPioView(this.context, res, mpl.altitude, mpl.nPos, mpl.isSelect, false)).anchor(0.5f, 0.73802954f).draggable(false));
    interestMarker.setFlat(true);
    return interestMarker;
}
 
Example 11
Source File: MapViewHandler.java    From PowerSwitch_Android with GNU General Public License v3.0 5 votes vote down vote up
public void updateMarker(String id, MarkerOptions markerOptions) {
    Marker marker = markers.get(id);
    marker.setPosition(markerOptions.getPosition());
    marker.setAlpha(markerOptions.getAlpha());
    marker.setDraggable(markerOptions.isDraggable());
    marker.setFlat(markerOptions.isFlat());
    marker.setIcon(markerOptions.getIcon());
    marker.setVisible(markerOptions.isVisible());
    marker.setTitle(markerOptions.getTitle());
    marker.setSnippet(markerOptions.getSnippet());
    marker.setRotation(markerOptions.getRotation());
    marker.setAnchor(markerOptions.getAnchorU(), markerOptions.getAnchorV());
    marker.setInfoWindowAnchor(markerOptions.getInfoWindowAnchorU(), markerOptions.getInfoWindowAnchorV());
}
 
Example 12
Source File: MarkerDemoActivity.java    From android-samples with Apache License 2.0 5 votes vote down vote up
/** Called when the Reset button is clicked. */
public void onToggleFlat(View view) {
    if (!checkReady()) {
        return;
    }
    boolean flat = mFlatBox.isChecked();
    for (Marker marker : mMarkerRainbow) {
        marker.setFlat(flat);
    }
}
 
Example 13
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 4 votes vote down vote up
public void setAiLineMarkByDevice(List<AckGetAiLinePoint> points, List<AckGetAiLinePoint> interestPoints) {
    for (AckGetAiLinePoint point : interestPoints) {
        addInterestByDevice(point);
    }
    for (AckGetAiLinePoint point2 : points) {
        int res;
        BitmapDescriptor mBitmapDescriptor;
        MapPointLatLng mp = new MapPointLatLng();
        mp.yawMode = point2.getYawMode();
        int index = findInterestPoint(point2, (List) interestPoints);
        if (index != -1) {
            mp.mInrertestPoint = (MapPointLatLng) ((Marker) this.interestMarkerList.get(index)).getTag();
        }
        mp.altitude = (float) point2.getAltitude();
        mp.nPos = this.mMarkerList.size() + 1;
        FLatLng fLatLng = GpsCorrect.Earth_To_Mars(point2.getLatitude(), point2.getLongitude());
        LatLng latLng = new LatLng(fLatLng.latitude, fLatLng.longitude);
        mp.longitude = latLng.longitude;
        mp.latitude = latLng.latitude;
        mp.setAngle(point2.getAngle());
        if (point2.getYawMode() == (byte) 0) {
            res = R.drawable.x8_ai_line_point_no_angle2;
        } else {
            res = R.drawable.x8_ai_line_point_with_angle1;
        }
        if (mp.mInrertestPoint != null) {
            mBitmapDescriptor = this.gdCustemMarkerView.createMapPointWithPioView(this.context, res, mp.altitude, mp.nPos, mp.mInrertestPoint.nPos, mp.showAngle, mp.isSelect, false);
        } else {
            mBitmapDescriptor = this.gdCustemMarkerView.createMapPointAngleNoPioView(this.context, res, mp.altitude, mp.nPos, mp.showAngle, mp.isSelect, false);
        }
        Marker mMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng).icon(mBitmapDescriptor).anchor(0.5f, 0.64285713f).draggable(false));
        mMarker.setTag(mp);
        mMarker.setFlat(true);
        this.mMarkerList.add(mMarker);
        mp.distance = 0.0f;
        this.mMapPointList.add(mp);
    }
    if (points.size() > 0) {
        drawPointLine(this.gglMapLocationManager.getDevLocation());
    }
}
 
Example 14
Source File: GglMapAiLineManager.java    From FimiX8-RE with MIT License 4 votes vote down vote up
public Marker addInterestMarker(LatLng latLng, float h, MapPointLatLng mpl) {
    Marker interestMarker = this.googleMap.addMarker(new MarkerOptions().position(latLng).icon(this.gdCustemMarkerView.createCustomMarkerView(this.context, R.drawable.x8_img_ai_line_inreterst_max1, h, mpl.nPos)).anchor(0.5f, 1.0f).draggable(false));
    interestMarker.setFlat(true);
    return interestMarker;
}