Skip to content

Commit

Permalink
Samples: improve overlays example #724, #944
Browse files Browse the repository at this point in the history
  • Loading branch information
devemux86 committed Apr 1, 2017
1 parent d7d514f commit c6ff2b0
Showing 1 changed file with 28 additions and 2 deletions.
@@ -1,6 +1,6 @@
/*
* Copyright 2013-2014 Ludwig M Brinckmann
* Copyright 2015-2016 devemux86
* Copyright 2015-2017 devemux86
*
* This program is free software: you can redistribute it and/or modify it under the
* terms of the GNU Lesser General Public License as published by the Free Software
Expand Down Expand Up @@ -133,7 +133,33 @@ protected void addOverlayLayers(Layers layers) {

Circle circle = new Circle(latLong3, 100, Utils.createPaint(
AndroidGraphicFactory.INSTANCE.createColor(Color.WHITE), 0,
Style.FILL), null);
Style.FILL), null) {
@Override
public boolean onLongPress(LatLong geoPoint, Point viewPosition,
Point tapPoint) {
if (this.contains(viewPosition, tapPoint)) {
Toast.makeText(
OverlayMapViewer.this,
"The Circle was long pressed at "
+ geoPoint.toString(), Toast.LENGTH_SHORT)
.show();
return true;
}
return false;
}

@Override
public boolean onTap(LatLong geoPoint, Point viewPosition,
Point tapPoint) {
if (this.contains(viewPosition, tapPoint)) {
Toast.makeText(OverlayMapViewer.this,
"The Circle was tapped " + geoPoint.toString(),
Toast.LENGTH_SHORT).show();
return true;
}
return false;
}
};

FixedPixelCircle tappableCircle = new FixedPixelCircle(
latLong6,
Expand Down

0 comments on commit c6ff2b0

Please sign in to comment.