0

necesito poder mostrar un numero dentro del marcador del mapa. Utilizo mapsforge en su version 0.13.0. El codigo de mi clase marcador es la siguiente:

public class MyMarker extends Marker {
private Context ctx;

public MyMarker(Context ctx, LatLong latLong, Bitmap bitmap, int horizontalOffset,
                int verticalOffset) {
    super(latLong, bitmap, horizontalOffset, verticalOffset);
    this.ctx = ctx;
}

@Override
public boolean onTap(LatLong tapLatLong, Point layerXY, Point tapXY) {
    if (this.contains(layerXY, tapXY)) {
        Toast.makeText(ctx, "Marker con latitud: " + tapLatLong.latitude + " y longitud: " + tapLatLong.longitude + " pulsado", Toast.LENGTH_SHORT).show();
        return true;
    }
    return super.onTap(tapLatLong, layerXY, tapXY);
}

}

3
  • Marca algùn error o que simplemente no se ve? como mandas llamar esta clase MyMarker desde tu mapa?
    – Jorgesys
    el 22 abr. 2020 a las 22:13
  • No, lo que no se es como hacer para mostrar el numero, y la llamo de esta manera: el 24 abr. 2020 a las 13:43
  • marker = new MyMarker(this, new LatLong(Double.parseDouble(latitud), Double.parseDouble(longitud)), AndroidGraphicFactory.convertToBitmap(getResources().getDrawable(R.drawable.ic_icon_posicion)), 0, 0); el 24 abr. 2020 a las 13:49

0

Tu Respuesta

By clicking “Publica tu respuesta”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Examina otras preguntas con la etiqueta o formula tu propia pregunta.