Java Code Examples for com.nextgis.maplib.datasource.GeoPoint

The following examples show how to use com.nextgis.maplib.datasource.GeoPoint. These examples are extracted from open source projects. 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 Project: android_maplibui   Author: nextgis   File: DrawItem.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public boolean intersectsVertices(GeoEnvelope screenEnv) {
    int point;
    for (int ring = 0; ring < mDrawItemsVertex.size(); ring++) {
        point = 0;
        float[] items = mDrawItemsVertex.get(ring);
        for (int i = 0; i < items.length - 1; i += 2) {
            if (screenEnv.contains(new GeoPoint(items[i], items[i + 1]))) {
                mSelectedRing = ring;
                mSelectedPoint = point;
                return true;
            }
            point += 2;
        }
    }

    return false;
}
 
Example #2
Source Project: android_maplibui   Author: nextgis   File: DrawItem.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public boolean intersectsEdges(GeoEnvelope screenEnv) {
    for (int ring = 0; ring < mDrawItemsEdge.size(); ring++) {
        float[] items = mDrawItemsEdge.get(ring);
        for (int i = 0; i < items.length - 1; i += 2) {
            if (screenEnv.contains(new GeoPoint(items[i], items[i + 1]))) {
                mSelectedPoint = i + 2;
                mSelectedRing = ring;
                insertNewPoint(mSelectedPoint, items[i], items[i + 1]);

                return true;
            }
        }
    }

    return false;
}
 
Example #3
Source Project: android_maplibui   Author: nextgis   File: Overlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void drawOnZooming(
        Canvas canvas,
        PointF currentFocusLocation,
        float scale,
        OverlayItem overlayItem,
        boolean scaleMarker)
{
    if(null == canvas || null == overlayItem || null == overlayItem.getMarker())
        return;

    if (!isVisible())
        return;

    GeoPoint offset = getScaledOffset(currentFocusLocation, overlayItem, scale, scaleMarker);
    float zoomedX = (float) (overlayItem.getScreenX() - offset.getX());
    float zoomedY = (float) (overlayItem.getScreenY() - offset.getY());

    Matrix matrix = new Matrix();

    if (scaleMarker) {
        matrix.postScale(scale, scale);
    }

    matrix.postTranslate(zoomedX, zoomedY);
    canvas.drawBitmap(overlayItem.getMarker(), matrix, null);
}
 
Example #4
Source Project: android_maplibui   Author: nextgis   File: OverlayItem.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public void setCoordinates(GeoPoint point)
{
    if (point != null) {
        switch (point.getCRS()) {
            case GeoConstants.CRS_WGS84:
                setCoordinatesFromWGS(point.getX(), point.getY());
                break;
            case GeoConstants.CRS_WEB_MERCATOR:
                mCoordinates.setCoordinates(point.getX(), point.getY());
                break;
        }

        mCoordinates.setCRS(point.getCRS());
    }

    updateScreenCoordinates();
}
 
Example #5
Source Project: android_maplibui   Author: nextgis   File: RulerOverlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void fillGeometry() {
    mRulerString.clear();
    mRulerPolygon.clear();
    float[] points = mRulerItem.getRing(0);

    if (points != null) {
        GeoPoint[] geoPoints = mMapViewOverlays.getMap().screenToMap(points);
        for (GeoPoint geoPoint : geoPoints) {
            mRulerString.add(geoPoint);

            if (geoPoints.length > 2)
                mRulerPolygon.add(geoPoint);
        }

        if (mListener != null)
            mListener.onLengthChanged(getLength());

        if (mListener != null && geoPoints.length > 2)
            mListener.onAreaChanged(getArea());
    }
}
 
Example #6
Source Project: android_maplibui   Author: nextgis   File: EditLayerOverlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected boolean movePointToLocation() {
    Activity parent = (Activity) mContext;
    Location location = mGpsEventSource.getLastKnownLocation();

    if (null != location) {
        //change to screen coordinates
        GeoPoint pt = new GeoPoint(location.getLongitude(), location.getLatitude());
        pt.setCRS(GeoConstants.CRS_WGS84);
        pt.project(GeoConstants.CRS_WEB_MERCATOR);
        GeoPoint screenPt = mMap.mapToScreen(pt);
        return moveSelectedPoint((float) screenPt.getX(), (float) screenPt.getY());
    } else
        Toast.makeText(parent, R.string.error_no_location, Toast.LENGTH_SHORT).show();

    return false;
}
 
Example #7
Source Project: android_maplibui   Author: nextgis   File: EditLayerOverlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void fillDrawLine(GeoLineString lineString) {
    GeoPoint[] geoPoints =
            lineString.getPoints().toArray(new GeoPoint[lineString.getPointCount()]);
    float[] points = mapToScreen(geoPoints);

    mSelectedItem = new DrawItem(DrawItem.TYPE_VERTEX, points);
    mDrawItems.add(mSelectedItem);

    if (points.length < 2)
        return;

    float[] edgePoints = new float[points.length - 2];
    for (int i = 0; i < points.length - 2; i++)
        edgePoints[i] = (points[i] + points[i + 2]) * .5f;

    mSelectedItem.addEdges(edgePoints);
}
 
Example #8
Source Project: android_maplibui   Author: nextgis   File: EditLayerOverlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void fillDrawRing(GeoLinearRing geoLinearRing) {
    GeoPoint[] geoPoints =
            geoLinearRing.getPoints().toArray(new GeoPoint[geoLinearRing.getPointCount()]);
    float[] points = mapToScreen(geoPoints);
    float[] edgePoints = new float[points.length];

    if (points.length == 0 || edgePoints.length < 2)
        return;

    for (int i = 0; i < points.length - 2; i++)
        edgePoints[i] = (points[i] + points[i + 2]) * .5f;

    edgePoints[edgePoints.length - 2] = (points[0] + points[points.length - 2]) * .5f;
    edgePoints[edgePoints.length - 1] = (points[1] + points[points.length - 1]) * .5f;

    mSelectedItem.addVertices(points);
    mSelectedItem.addEdges(edgePoints);
}
 
Example #9
Source Project: android_maplibui   Author: nextgis   File: CurrentLocationOverlay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
private void autopanTo(Location autopanLocation, Location location) {
    GeoPoint oldLocation = new GeoPoint(autopanLocation.getLongitude(), autopanLocation.getLatitude());
    GeoPoint newLocation = new GeoPoint(location.getLongitude(), location.getLatitude());
    oldLocation.setCRS(GeoConstants.CRS_WGS84);
    oldLocation.project(GeoConstants.CRS_WEB_MERCATOR);
    newLocation.setCRS(GeoConstants.CRS_WGS84);
    newLocation.project(GeoConstants.CRS_WEB_MERCATOR);

    double dx = oldLocation.getX() - newLocation.getX();
    double dy = oldLocation.getY() - newLocation.getY();
    GeoPoint newCenter = mMapViewOverlays.getMapCenter();
    newCenter.setX(newCenter.getX() - dx);
    newCenter.setY(newCenter.getY() - dy);

    mMapViewOverlays.panTo(newCenter);
}
 
Example #10
Source Project: android_maplibui   Author: nextgis   File: MapView.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void zoomStop()
{
    if (mDrawingState == DRAW_STATE_zooming && mMap != null) {

        float zoom = MapUtil.getZoomForScaleFactor(mScaleFactor, mMap.getZoomLevel());

        GeoEnvelope env = mMap.getFullScreenBounds();
        GeoPoint focusPt = new GeoPoint(-mCurrentFocusLocation.x, -mCurrentFocusLocation.y);

        double invertScale = 1 / mScaleFactor;

        double offX = (1 - invertScale) * focusPt.getX();
        double offY = (1 - invertScale) * focusPt.getY();
        env.scale(invertScale);
        env.offset(offX, offY);

        GeoPoint newCenterPt = env.getCenter();
        GeoPoint newCenterPtMap = mMap.screenToMap(newCenterPt);

        if(Constants.DEBUG_MODE) {
            Log.d(TAG, "zoomStop: setZoomAndCenter");
        }

        setZoomAndCenter(zoom, newCenterPtMap);
    }
}
 
Example #11
Source Project: android_maplib   Author: nextgis   File: SimpleMarkerStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw(GeoGeometry geoGeometry, GISDisplay display) {
    switch (geoGeometry.getType()) {
        case GTPoint:
            GeoPoint pt = (GeoPoint) geoGeometry;
            onDraw(pt, display);
            break;
        case GTMultiPoint:
            GeoMultiPoint multiPoint = (GeoMultiPoint) geoGeometry;
            for (int i = 0; i < multiPoint.size(); i++) {
                onDraw(multiPoint.get(i), display);
            }
            break;

        //throw new IllegalArgumentException(
        //        "The input geometry type is not support by this style");
    }
}
 
Example #12
Source Project: android_maplib   Author: nextgis   File: SimplePolygonStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
@Override
public void onDraw(GeoGeometry geoGeometry, GISDisplay display) {
    Float textSize = (null == mTextSize) ? null : 12f;
    float scaledTextSize = (float) (mTextSize * (mWidth / display.getScale()));
    GeoPoint center = geoGeometry.getEnvelope().getCenter();
    switch (geoGeometry.getType()) {
        case GTPolygon:
            drawPolygon((GeoPolygon) geoGeometry, display);
            drawText(scaledTextSize, center, display);
            break;
        case GTMultiPolygon:
            GeoMultiPolygon multiPolygon = (GeoMultiPolygon) geoGeometry;

            for (int i = 0; i < multiPolygon.size(); i++) {
                drawPolygon(multiPolygon.get(i), display);
                drawText(scaledTextSize, center, display);
            }
            break;

        //throw new IllegalArgumentException(
        //        "The input geometry type is not support by this style");
    }
}
 
Example #13
Source Project: android_maplib   Author: nextgis   File: SimplePolygonStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void appendPath(Path polygonPath, List<GeoPoint> points) {
    float x0, y0;

    if (points.size() > 0) {
        x0 = (float) points.get(0).getX();
        y0 = (float) points.get(0).getY();
        polygonPath.moveTo(x0, y0);

        for (int i = 1; i < points.size(); i++) {
            x0 = (float) points.get(i).getX();
            y0 = (float) points.get(i).getY();

            polygonPath.lineTo(x0, y0);
        }

        polygonPath.close();
    }
}
 
Example #14
Source Project: android_maplib   Author: nextgis   File: GISDisplay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public GISDisplay(Bitmap backgroundTile)
{
    mBkBitmap = backgroundTile;
    //set max zoom
    mMinZoomLevel = 0;
    mMaxZoomLevel = DEFAULT_MAX_ZOOM;
    mLimitType = MAP_LIMITS_Y;

    // default extent
    // set full Mercator bounds
    mFullBounds = new GeoEnvelope(-MERCATOR_MAX, MERCATOR_MAX, -MERCATOR_MAX, MERCATOR_MAX);
    mGeoLimits = mFullBounds;
    mCenter = mGeoLimits.getCenter();

    //default transform matrix
    mTransformMatrix = new Matrix();
    mInvertTransformMatrix = new Matrix();
    mMapTileSize = new GeoPoint();

    setSize(300, 300);

    mRasterPaint = new Paint();
    mRasterPaint.setAntiAlias(true);
    mRasterPaint.setFilterBitmap(true);
    mRasterPaint.setDither(true);
}
 
Example #15
Source Project: android_maplib   Author: nextgis   File: GISDisplay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public synchronized void draw(
        Canvas canvas,
        float x,
        float y,
        float scale)
{
    clearBackground(canvas);

    if (null == canvas) {
        return;
    }

    GeoPoint pt = getScaledOffset(x, y, scale);

    float mainBitmapOffsetX = (float) pt.getX();
    float mainBitmapOffsetY = (float) pt.getY();

    Matrix matrix = new Matrix();
    matrix.postScale(scale, scale);
    matrix.postTranslate(-mainBitmapOffsetX, -mainBitmapOffsetY);
    //Log.d(TAG, "matix: " + matrix.toShortString());

    canvas.drawBitmap(mDoubleBufferBitmap, matrix, mRasterPaint);
}
 
Example #16
Source Project: android_maplib   Author: nextgis   File: GISDisplay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public GeoPoint getScaledOffset(
        float x,
        float y,
        float scale)
{
    float dxOld = x - mWidth / 2;
    float dyOld = y - mHeight / 2;

    float scaledWidth = mMainBitmap.getWidth() * scale;
    float scaledHeight = mMainBitmap.getHeight() * scale;

    GeoPoint ret = new GeoPoint();
    ret.setX((scaledWidth - mWidth) / 2 - (1 - scale) * dxOld);
    ret.setY((scaledHeight - mHeight) / 2 - (1 - scale) * dyOld);
    return ret;
}
 
Example #17
Source Project: android_maplib   Author: nextgis   File: GISDisplay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public void drawBitmap(
        Bitmap bitmap,
        GeoPoint point,
        float offsetX,
        float offsetY)
{
    if (null == mMainCanvas) {
        return;
    }

    Matrix matrix = new Matrix();
    matrix.postScale((float) mInvertScale, (float) -mInvertScale);
    matrix.postTranslate((float) point.getX(), (float) point.getY());
    matrix.postTranslate((float) (offsetX / mScale), (float) (offsetY / mScale));
    mMainCanvas.drawBitmap(bitmap, matrix, new Paint(Paint.ANTI_ALIAS_FLAG));
}
 
Example #18
Source Project: android_maplib   Author: nextgis   File: GISDisplay.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
public float[] mapToScreen(final GeoPoint[] points)
{
    if (null == points) {
        return null;
    }
    float dfPoints[] = new float[points.length * 2];
    for (int i = 0; i < points.length; i++) {
        int pos = i * 2;
        dfPoints[pos] = (float) points[i].getX();
        dfPoints[pos + 1] = (float) points[i].getY();
    }

    mTransformMatrix.mapPoints(dfPoints);

    return dfPoints;
}
 
Example #19
Source Project: android_maplib   Author: nextgis   File: SimpleLineStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected Path drawSolidLine(float scaledWidth, GeoLineString lineString, GISDisplay display) {
    Paint paint = new Paint();
    paint.setColor(mColor);
    paint.setAntiAlias(true);
    paint.setStyle(Paint.Style.STROKE);
    paint.setStrokeCap(mStrokeCap);
    paint.setStrokeWidth(scaledWidth);

    List<GeoPoint> points = lineString.getPoints();

    Path path = new Path();
    path.incReserve(points.size());

    path.moveTo((float) points.get(0).getX(), (float) points.get(0).getY());

    for (int i = 1; i < points.size(); ++i) {
        path.lineTo((float) points.get(i).getX(), (float) points.get(i).getY());
    }

    display.drawPath(path, paint);

    return path;
}
 
Example #20
Source Project: android_maplib   Author: nextgis   File: SimpleTiledPolygonStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected Path getPath(GeoLineString lineString) {
    List<GeoPoint> points = lineString.getPoints();
    Path path = new Path();
    float x0, y0;

    if (points.size() > 0) {
        x0 = (float) points.get(0).getX();
        y0 = (float) points.get(0).getY();
        path.moveTo(x0, y0);

        for (int i = 1; i < points.size(); i++) {
            x0 = (float) points.get(i).getX();
            y0 = (float) points.get(i).getY();

            path.lineTo(x0, y0);
        }
    }

    return path;
}
 
Example #21
Source Project: android_maplib   Author: nextgis   File: SimpleTiledPolygonStyle.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
protected void appendPath(Path polygonPath, List<GeoPoint> points) {
    float x0, y0;

    if (points.size() > 0) {
        x0 = (float) points.get(0).getX();
        y0 = (float) points.get(0).getY();
        polygonPath.moveTo(x0, y0);

        for (int i = 1; i < points.size(); i++) {
            x0 = (float) points.get(i).getX();
            y0 = (float) points.get(i).getY();

            polygonPath.lineTo(x0, y0);
        }

        polygonPath.close();
    }
}
 
Example #22
Source Project: android_maplib   Author: nextgis   File: TrackLayer.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
private void loadTrack(int trackId)
{
    Cursor track = getTrack(trackId);

    if (track == null || !track.moveToFirst()) {
        return;
    }

    float x0 = track.getFloat(track.getColumnIndex(TrackLayer.FIELD_LON)),
            y0 = track.getFloat(track.getColumnIndex(TrackLayer.FIELD_LAT));

    GeoLineString trackLine = new GeoLineString();
    trackLine.setCRS(GeoConstants.CRS_WEB_MERCATOR);
    trackLine.add(new GeoPoint(x0, y0));

    while (track.moveToNext()) {
        x0 = track.getFloat(track.getColumnIndex(TrackLayer.FIELD_LON));
        y0 = track.getFloat(track.getColumnIndex(TrackLayer.FIELD_LAT));
        trackLine.add(new GeoPoint(x0, y0));
    }

    mTracks.put(trackId, trackLine);
}
 
Example #23
Source Project: android_maplib   Author: nextgis   File: MapDrawable.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Set new map extent according zoom level and center
 *
 * @param zoom
 *         A zoom level
 * @param center
 *         A map center coordinates
 */
@Override
public void setZoomAndCenter(
        float zoom,
        GeoPoint center)
{
    if (mDisplay != null) {
        float newZoom = zoom;
        if (zoom < mDisplay.getMinZoomLevel()) {
            newZoom = mDisplay.getMinZoomLevel();
        } else if (zoom > mDisplay.getMaxZoomLevel()) {
            newZoom = mDisplay.getMaxZoomLevel();
        }

        newZoom = Math.round(newZoom);
        mDisplay.setZoomAndCenter(newZoom, center);
        onExtentChanged((int) newZoom, center);
    }
}
 
Example #24
Source Project: android_maplib   Author: nextgis   File: MapEventSource.java    License: GNU Lesser General Public License v3.0 6 votes vote down vote up
/**
 * Send extent change event to all listeners
 *
 * @param zoom
 *         A zoom level
 * @param center
 *         A map center coordinates
 */
@Override
protected void onExtentChanged(
        float zoom,
        GeoPoint center)
{
    super.onExtentChanged(zoom, center);
    if (mListeners == null) {
        return;
    }

    Bundle bundle = new Bundle();
    bundle.putFloat(BUNDLE_ZOOM_KEY, zoom);
    bundle.putDouble(BUNDLE_X_KEY, center.getX());
    bundle.putDouble(BUNDLE_Y_KEY, center.getY());
    bundle.putInt(BUNDLE_TYPE_KEY, EVENT_onExtentChanged);

    Message msg = new Message();
    msg.setData(bundle);
    mHandler.sendMessage(msg);
}
 
Example #25
Source Project: android_maplibui   Author: nextgis   File: DrawItem.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
public boolean isTapNearSelectedPoint(GeoEnvelope screenEnv) {
    float[] points = getSelectedRing();
    if (null != points && mSelectedPoint >= 0 && points.length > mSelectedPoint + 1) {
        if (screenEnv.contains(new GeoPoint(points[mSelectedPoint], points[mSelectedPoint + 1]))) {
            return true;
        }
    }
    return false;
}
 
Example #26
Source Project: android_maplibui   Author: nextgis   File: Overlay.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
public GeoPoint getScaledOffset(
        PointF currentFocusLocation,
        OverlayItem overlayItem,
        float scale,
        boolean scaleMarker)
{
    if(null == overlayItem || null == overlayItem.getMarker())
        return new GeoPoint();

    double x = overlayItem.getScreenCoordinates().x;
    double y = overlayItem.getScreenCoordinates().y;
    int markerWidth = overlayItem.getMarker().getWidth();
    int markerHeight = overlayItem.getMarker().getHeight();

    double dx = x + markerWidth / 2 + currentFocusLocation.x;
    double dy = y + markerHeight / 2 + currentFocusLocation.y;

    GeoPoint offset = new GeoPoint();

    if (!scaleMarker) {
        markerHeight = markerWidth = 0;
    }

    float scaledWidth = markerWidth * scale;
    float scaledHeight = markerHeight * scale;

    offset.setX((scaledWidth - markerWidth) / 2 + (1 - scale) * dx);
    offset.setY((scaledHeight - markerHeight) / 2 + (1 - scale) * dy);

    return offset;
}
 
Example #27
Source Project: android_maplibui   Author: nextgis   File: OverlayItem.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
public GeoPoint getCoordinates(int CRS)
{
    if (CRS == GeoConstants.CRS_WGS84) {
        GeoPoint wgs = new GeoPoint(mCoordinates.getX(), mCoordinates.getY());
        wgs.setCRS(GeoConstants.CRS_WEB_MERCATOR);
        wgs.project(GeoConstants.CRS_WGS84);
        return wgs;
    }

    return mCoordinates;
}
 
Example #28
Source Project: android_maplibui   Author: nextgis   File: RulerOverlay.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
protected void fillDrawItem() {
    GeoPoint[] geoPoints = mRulerString.getPoints().toArray(new GeoPoint[mRulerString.getPointCount()]);
    if (geoPoints.length == 0)
        geoPoints = null;
    float[] points = mMapViewOverlays.getMap().mapToScreen(geoPoints);

    int selectedPoint = 0;
    if (mRulerItem != null)
        selectedPoint = mRulerItem.getSelectedPointId();

    mRulerItem = new DrawItem(DrawItem.TYPE_VERTEX, points);
    mRulerItem.addVertices(points);

    mRulerItem.setSelectedPoint(selectedPoint);
}
 
Example #29
Source Project: android_maplibui   Author: nextgis   File: EditLayerOverlay.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
public void setOverlayPoint(MotionEvent event) {
    GeoPoint mapPoint = mMap.screenToMap(new GeoPoint(event.getX(), event.getY()));
    mapPoint.setCRS(GeoConstants.CRS_WEB_MERCATOR);
    mapPoint.project(GeoConstants.CRS_WGS84);
    mOverlayPoint.setCoordinates(mapPoint);
    mOverlayPoint.setVisible(true);
}
 
Example #30
Source Project: android_maplibui   Author: nextgis   File: EditLayerOverlay.java    License: GNU Lesser General Public License v3.0 5 votes vote down vote up
@Override
public void drawOnPanning(
        Canvas canvas,
        PointF currentMouseOffset) {
    if (mOverlayPoint.isVisible())
        drawOnPanning(canvas, currentMouseOffset, mOverlayPoint);

    List<DrawItem> drawItems = mDrawItems;
    for (DrawItem drawItem : drawItems) {
        boolean isSelected = mSelectedItem == drawItem;

        if (mMode != MODE_CHANGE && mMode != MODE_EDIT_BY_TOUCH) {
            drawItem = drawItem.pan(currentMouseOffset);

            if (isSelected) {
                drawItem.setSelectedRing(mSelectedItem.getSelectedRingId());
                drawItem.setSelectedPoint(mSelectedItem.getSelectedPointId());
            }
        }

        drawItem(drawItem, canvas, isSelected);
        if (mLayer != null) {
            int type = mLayer.getGeometryType();
            if (type == GeoConstants.GTPoint || type == GeoConstants.GTMultiPoint) {
                GeoPoint geometry = (GeoPoint) getBaseGeometry(mMap, GeoConstants.GTPoint, mSelectedItem);
                Location last = mGpsEventSource.getLastKnownLocation();
                updateDistance(last, geometry);
            }
        }
    }

    drawCross(canvas);
}