repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java | TileSourceFactory.getTileSource | @Deprecated
public static ITileSource getTileSource(final int aOrdinal) throws IllegalArgumentException {
for (final ITileSource tileSource : mTileSources) {
if (tileSource.ordinal() == aOrdinal) {
return tileSource;
}
}
throw new IllegalArgumentException("No tile source at position: " + aOrdinal);
} | java | @Deprecated
public static ITileSource getTileSource(final int aOrdinal) throws IllegalArgumentException {
for (final ITileSource tileSource : mTileSources) {
if (tileSource.ordinal() == aOrdinal) {
return tileSource;
}
}
throw new IllegalArgumentException("No tile source at position: " + aOrdinal);
} | [
"@",
"Deprecated",
"public",
"static",
"ITileSource",
"getTileSource",
"(",
"final",
"int",
"aOrdinal",
")",
"throws",
"IllegalArgumentException",
"{",
"for",
"(",
"final",
"ITileSource",
"tileSource",
":",
"mTileSources",
")",
"{",
"if",
"(",
"tileSource",
".",
... | Get the tile source at the specified position.
@param aOrdinal
@return the tile source
@throws IllegalArgumentException
if tile source not found | [
"Get",
"the",
"tile",
"source",
"at",
"the",
"specified",
"position",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java#L56-L64 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java | TileSourceFactory.removeTileSources | public static int removeTileSources(final String aRegex) {
int n=0;
for (int i=mTileSources.size()-1; i>=0; --i) {
if (mTileSources.get(i).name().matches(aRegex)) {
mTileSources.remove(i);
++n;
}
}
return n;
} | java | public static int removeTileSources(final String aRegex) {
int n=0;
for (int i=mTileSources.size()-1; i>=0; --i) {
if (mTileSources.get(i).name().matches(aRegex)) {
mTileSources.remove(i);
++n;
}
}
return n;
} | [
"public",
"static",
"int",
"removeTileSources",
"(",
"final",
"String",
"aRegex",
")",
"{",
"int",
"n",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"mTileSources",
".",
"size",
"(",
")",
"-",
"1",
";",
"i",
">=",
"0",
";",
"--",
"i",
")",
"{",
... | removes any tile sources whose name matches the regular expression
@param aRegex regular expression
@return number of sources removed | [
"removes",
"any",
"tile",
"sources",
"whose",
"name",
"matches",
"the",
"regular",
"expression"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/TileSourceFactory.java#L88-L97 | train |
osmdroid/osmdroid | osmdroid-server-jdk/src/main/java/org/osmdroid/server/jdk/TileServer.java | TileServer.startServer | private static void startServer() throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(TileFetcher.class);
List<Object> providers = new ArrayList<Object>();
// add custom providers if any
providers.add(new org.apache.cxf.ja... | java | private static void startServer() throws Exception {
JAXRSServerFactoryBean sf = new JAXRSServerFactoryBean();
sf.setResourceClasses(TileFetcher.class);
List<Object> providers = new ArrayList<Object>();
// add custom providers if any
providers.add(new org.apache.cxf.ja... | [
"private",
"static",
"void",
"startServer",
"(",
")",
"throws",
"Exception",
"{",
"JAXRSServerFactoryBean",
"sf",
"=",
"new",
"JAXRSServerFactoryBean",
"(",
")",
";",
"sf",
".",
"setResourceClasses",
"(",
"TileFetcher",
".",
"class",
")",
";",
"List",
"<",
"Ob... | this files up a CXF based Jetty server to host tile rest service
@throws Exception | [
"this",
"files",
"up",
"a",
"CXF",
"based",
"Jetty",
"server",
"to",
"host",
"tile",
"rest",
"service"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-server-jdk/src/main/java/org/osmdroid/server/jdk/TileServer.java#L59-L75 | train |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java | OsmdroidShapeMarkers.add | public void add(ShapeMarkers shapeMarkers) {
for (Marker marker : shapeMarkers.getMarkers()) {
add(marker, shapeMarkers);
}
} | java | public void add(ShapeMarkers shapeMarkers) {
for (Marker marker : shapeMarkers.getMarkers()) {
add(marker, shapeMarkers);
}
} | [
"public",
"void",
"add",
"(",
"ShapeMarkers",
"shapeMarkers",
")",
"{",
"for",
"(",
"Marker",
"marker",
":",
"shapeMarkers",
".",
"getMarkers",
"(",
")",
")",
"{",
"add",
"(",
"marker",
",",
"shapeMarkers",
")",
";",
"}",
"}"
] | Add all markers in the shape
@param shapeMarkers | [
"Add",
"all",
"markers",
"in",
"the",
"shape"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java#L86-L90 | train |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java | OsmdroidShapeMarkers.addMarkerAsPolyline | public static void addMarkerAsPolyline(Marker marker, List<Marker> markers) {
GeoPoint position = marker.getPosition();
int insertLocation = markers.size();
if (markers.size() > 1) {
double[] distances = new double[markers.size()];
insertLocation = 0;
distance... | java | public static void addMarkerAsPolyline(Marker marker, List<Marker> markers) {
GeoPoint position = marker.getPosition();
int insertLocation = markers.size();
if (markers.size() > 1) {
double[] distances = new double[markers.size()];
insertLocation = 0;
distance... | [
"public",
"static",
"void",
"addMarkerAsPolyline",
"(",
"Marker",
"marker",
",",
"List",
"<",
"Marker",
">",
"markers",
")",
"{",
"GeoPoint",
"position",
"=",
"marker",
".",
"getPosition",
"(",
")",
";",
"int",
"insertLocation",
"=",
"markers",
".",
"size",
... | Polyline add a marker in the list of markers to where it is closest to
the the surrounding points
@param marker
@param markers | [
"Polyline",
"add",
"a",
"marker",
"in",
"the",
"list",
"of",
"markers",
"to",
"where",
"it",
"is",
"closest",
"to",
"the",
"the",
"surrounding",
"points"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/features/OsmdroidShapeMarkers.java#L245-L288 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java | Marker.showInfoWindow | public void showInfoWindow(){
if (mInfoWindow == null)
return;
final int markerWidth = mIcon.getIntrinsicWidth();
final int markerHeight = mIcon.getIntrinsicHeight();
final int offsetX = (int)(markerWidth * (mIWAnchorU - mAnchorU));
final int offsetY = (int)(markerHeight * (mIWAnchorV - mAnchorV));
if (m... | java | public void showInfoWindow(){
if (mInfoWindow == null)
return;
final int markerWidth = mIcon.getIntrinsicWidth();
final int markerHeight = mIcon.getIntrinsicHeight();
final int offsetX = (int)(markerWidth * (mIWAnchorU - mAnchorU));
final int offsetY = (int)(markerHeight * (mIWAnchorV - mAnchorV));
if (m... | [
"public",
"void",
"showInfoWindow",
"(",
")",
"{",
"if",
"(",
"mInfoWindow",
"==",
"null",
")",
"return",
";",
"final",
"int",
"markerWidth",
"=",
"mIcon",
".",
"getIntrinsicWidth",
"(",
")",
";",
"final",
"int",
"markerHeight",
"=",
"mIcon",
".",
"getIntr... | shows the info window, if it's open, this will close and reopen it | [
"shows",
"the",
"info",
"window",
"if",
"it",
"s",
"open",
"this",
"will",
"close",
"and",
"reopen",
"it"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java#L298-L317 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java | Marker.onDetach | @Override
public void onDetach(MapView mapView) {
BitmapPool.getInstance().asyncRecycle(mIcon);
mIcon=null;
BitmapPool.getInstance().asyncRecycle(mImage);
//cleanDefaults();
this.mOnMarkerClickListener=null;
this.mOnMarkerDragListener=null;
this.mResources=null;
setRelatedObject(null);
if (isInfoWind... | java | @Override
public void onDetach(MapView mapView) {
BitmapPool.getInstance().asyncRecycle(mIcon);
mIcon=null;
BitmapPool.getInstance().asyncRecycle(mImage);
//cleanDefaults();
this.mOnMarkerClickListener=null;
this.mOnMarkerDragListener=null;
this.mResources=null;
setRelatedObject(null);
if (isInfoWind... | [
"@",
"Override",
"public",
"void",
"onDetach",
"(",
"MapView",
"mapView",
")",
"{",
"BitmapPool",
".",
"getInstance",
"(",
")",
".",
"asyncRecycle",
"(",
"mIcon",
")",
";",
"mIcon",
"=",
"null",
";",
"BitmapPool",
".",
"getInstance",
"(",
")",
".",
"asyn... | Null out the static references when the MapView is detached to prevent memory leaks. | [
"Null",
"out",
"the",
"static",
"references",
"when",
"the",
"MapView",
"is",
"detached",
"to",
"prevent",
"memory",
"leaks",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Marker.java#L342-L362 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java | PointReducer.orthogonalDistance | public static double orthogonalDistance(GeoPoint point, GeoPoint lineStart, GeoPoint lineEnd)
{
double area = Math.abs(
(
lineStart.getLatitude() * lineEnd.getLongitude()
+ lineEnd.getLatitude() * point.getLongitude()
+ point.getLatitude() ... | java | public static double orthogonalDistance(GeoPoint point, GeoPoint lineStart, GeoPoint lineEnd)
{
double area = Math.abs(
(
lineStart.getLatitude() * lineEnd.getLongitude()
+ lineEnd.getLatitude() * point.getLongitude()
+ point.getLatitude() ... | [
"public",
"static",
"double",
"orthogonalDistance",
"(",
"GeoPoint",
"point",
",",
"GeoPoint",
"lineStart",
",",
"GeoPoint",
"lineEnd",
")",
"{",
"double",
"area",
"=",
"Math",
".",
"abs",
"(",
"(",
"lineStart",
".",
"getLatitude",
"(",
")",
"*",
"lineEnd",
... | Calculate the orthogonal distance from the line joining the
lineStart and lineEnd points to point
@param point The point the distance is being calculated for
@param lineStart The point that starts the line
@param lineEnd The point that ends the line
@return The distance in points coordinate system | [
"Calculate",
"the",
"orthogonal",
"distance",
"from",
"the",
"line",
"joining",
"the",
"lineStart",
"and",
"lineEnd",
"points",
"to",
"point"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/PointReducer.java#L134-L153 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StoragePreferenceFragment.java | StoragePreferenceFragment.onClick | @Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonManualCacheEntry: {
showManualEntry();
}
break;
case R.id.buttonSetCache: {
showPickCacheFromList();
}
break;
}
} | java | @Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.buttonManualCacheEntry: {
showManualEntry();
}
break;
case R.id.buttonSetCache: {
showPickCacheFromList();
}
break;
}
} | [
"@",
"Override",
"public",
"void",
"onClick",
"(",
"View",
"v",
")",
"{",
"switch",
"(",
"v",
".",
"getId",
"(",
")",
")",
"{",
"case",
"R",
".",
"id",
".",
"buttonManualCacheEntry",
":",
"{",
"showManualEntry",
"(",
")",
";",
"}",
"break",
";",
"c... | END PERMISSION CHECK | [
"END",
"PERMISSION",
"CHECK"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/intro/StoragePreferenceFragment.java#L96-L110 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/FolderOverlay.java | FolderOverlay.closeAllInfoWindows | public void closeAllInfoWindows(){
for (Overlay overlay:mOverlayManager){
if (overlay instanceof FolderOverlay){
((FolderOverlay)overlay).closeAllInfoWindows();
} else if (overlay instanceof OverlayWithIW){
((OverlayWithIW)overlay).closeInfoWindow();
}
}
} | java | public void closeAllInfoWindows(){
for (Overlay overlay:mOverlayManager){
if (overlay instanceof FolderOverlay){
((FolderOverlay)overlay).closeAllInfoWindows();
} else if (overlay instanceof OverlayWithIW){
((OverlayWithIW)overlay).closeInfoWindow();
}
}
} | [
"public",
"void",
"closeAllInfoWindows",
"(",
")",
"{",
"for",
"(",
"Overlay",
"overlay",
":",
"mOverlayManager",
")",
"{",
"if",
"(",
"overlay",
"instanceof",
"FolderOverlay",
")",
"{",
"(",
"(",
"FolderOverlay",
")",
"overlay",
")",
".",
"closeAllInfoWindows... | Close all opened InfoWindows of overlays it contains.
This only operates on overlays that inherit from OverlayWithIW. | [
"Close",
"all",
"opened",
"InfoWindows",
"of",
"overlays",
"it",
"contains",
".",
"This",
"only",
"operates",
"on",
"overlays",
"that",
"inherit",
"from",
"OverlayWithIW",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/FolderOverlay.java#L117-L125 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/BingMapTileSource.java | BingMapTileSource.getMetaData | private ImageryMetaDataResource getMetaData() {
Log.d(IMapView.LOGTAG, "getMetaData");
ImageryMetaDataResource returnValue = null;
InputStream in = null;
HttpURLConnection client = null;
ByteArrayOutputStream dataStream = null;
BufferedOutputStream out = null;
t... | java | private ImageryMetaDataResource getMetaData() {
Log.d(IMapView.LOGTAG, "getMetaData");
ImageryMetaDataResource returnValue = null;
InputStream in = null;
HttpURLConnection client = null;
ByteArrayOutputStream dataStream = null;
BufferedOutputStream out = null;
t... | [
"private",
"ImageryMetaDataResource",
"getMetaData",
"(",
")",
"{",
"Log",
".",
"d",
"(",
"IMapView",
".",
"LOGTAG",
",",
"\"getMetaData\"",
")",
";",
"ImageryMetaDataResource",
"returnValue",
"=",
"null",
";",
"InputStream",
"in",
"=",
"null",
";",
"HttpURLConn... | Gets the imagery meta from the REST service, or null if it fails | [
"Gets",
"the",
"imagery",
"meta",
"from",
"the",
"REST",
"service",
"or",
"null",
"if",
"it",
"fails"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/BingMapTileSource.java#L227-L288 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/NetworkLocationIgnorer.java | NetworkLocationIgnorer.shouldIgnore | public boolean shouldIgnore(final String pProvider, final long pTime) {
if (LocationManager.GPS_PROVIDER.equals(pProvider)) {
mLastGps = pTime;
} else {
if (pTime < mLastGps + Configuration.getInstance().getGpsWaitTime()) {
return true;
}
}
return false;
} | java | public boolean shouldIgnore(final String pProvider, final long pTime) {
if (LocationManager.GPS_PROVIDER.equals(pProvider)) {
mLastGps = pTime;
} else {
if (pTime < mLastGps + Configuration.getInstance().getGpsWaitTime()) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"shouldIgnore",
"(",
"final",
"String",
"pProvider",
",",
"final",
"long",
"pTime",
")",
"{",
"if",
"(",
"LocationManager",
".",
"GPS_PROVIDER",
".",
"equals",
"(",
"pProvider",
")",
")",
"{",
"mLastGps",
"=",
"pTime",
";",
"}",
"else"... | Whether we should ignore this location.
@param pProvider
the provider that provided the location
@param pTime
the time of the location
@return true if we should ignore this location, false if not | [
"Whether",
"we",
"should",
"ignore",
"this",
"location",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/NetworkLocationIgnorer.java#L30-L41 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ScaleBarOverlay.java | ScaleBarOverlay.adjustScaleBarLength | private double adjustScaleBarLength(double length) {
long pow = 0;
boolean feet = false;
if (unitsOfMeasure == UnitsOfMeasure.imperial) {
if (length >= GeoConstants.METERS_PER_STATUTE_MILE / 5)
length = length / GeoConstants.METERS_PER_STATUTE_MILE;
else {
length = length * GeoConstants.FEET_PER_MET... | java | private double adjustScaleBarLength(double length) {
long pow = 0;
boolean feet = false;
if (unitsOfMeasure == UnitsOfMeasure.imperial) {
if (length >= GeoConstants.METERS_PER_STATUTE_MILE / 5)
length = length / GeoConstants.METERS_PER_STATUTE_MILE;
else {
length = length * GeoConstants.FEET_PER_MET... | [
"private",
"double",
"adjustScaleBarLength",
"(",
"double",
"length",
")",
"{",
"long",
"pow",
"=",
"0",
";",
"boolean",
"feet",
"=",
"false",
";",
"if",
"(",
"unitsOfMeasure",
"==",
"UnitsOfMeasure",
".",
"imperial",
")",
"{",
"if",
"(",
"length",
">=",
... | Returns a reduced length that starts with 1, 2 or 5 and trailing zeros. If set to nautical or
imperial the input will be transformed before and after the reduction so that the result
holds in that respective unit.
@param length
length to round
@return reduced, rounded (in m, nm or mi depending on setting) result | [
"Returns",
"a",
"reduced",
"length",
"that",
"starts",
"with",
"1",
"2",
"or",
"5",
"and",
"trailing",
"zeros",
".",
"If",
"set",
"to",
"nautical",
"or",
"imperial",
"the",
"input",
"will",
"be",
"transformed",
"before",
"and",
"after",
"the",
"reduction",... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ScaleBarOverlay.java#L619-L662 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/LocationUtils.java | LocationUtils.getLastKnownLocation | public static Location getLastKnownLocation(final LocationManager pLocationManager) {
if (pLocationManager == null) {
return null;
}
final Location gpsLocation = getLastKnownLocation(pLocationManager, LocationManager.GPS_PROVIDER);
final Location networkLocation = getLastKnownLocation(pLocationManager, Locat... | java | public static Location getLastKnownLocation(final LocationManager pLocationManager) {
if (pLocationManager == null) {
return null;
}
final Location gpsLocation = getLastKnownLocation(pLocationManager, LocationManager.GPS_PROVIDER);
final Location networkLocation = getLastKnownLocation(pLocationManager, Locat... | [
"public",
"static",
"Location",
"getLastKnownLocation",
"(",
"final",
"LocationManager",
"pLocationManager",
")",
"{",
"if",
"(",
"pLocationManager",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"final",
"Location",
"gpsLocation",
"=",
"getLastKnownLocation",... | Get the most recent location from the GPS or Network provider.
@return return the most recent location, or null if there's no known location | [
"Get",
"the",
"most",
"recent",
"location",
"from",
"the",
"GPS",
"or",
"Network",
"provider",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/LocationUtils.java#L21-L39 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java | Polygon.setInfoWindow | public void setInfoWindow(InfoWindow infoWindow){
if (mInfoWindow != null){
if (mInfoWindow.getRelatedObject()==this)
mInfoWindow.setRelatedObject(null);
}
mInfoWindow = infoWindow;
} | java | public void setInfoWindow(InfoWindow infoWindow){
if (mInfoWindow != null){
if (mInfoWindow.getRelatedObject()==this)
mInfoWindow.setRelatedObject(null);
}
mInfoWindow = infoWindow;
} | [
"public",
"void",
"setInfoWindow",
"(",
"InfoWindow",
"infoWindow",
")",
"{",
"if",
"(",
"mInfoWindow",
"!=",
"null",
")",
"{",
"if",
"(",
"mInfoWindow",
".",
"getRelatedObject",
"(",
")",
"==",
"this",
")",
"mInfoWindow",
".",
"setRelatedObject",
"(",
"null... | Set the InfoWindow to be used.
Default is a BasicInfoWindow, with the layout named "bonuspack_bubble".
You can use this method either to use your own layout, or to use your own sub-class of InfoWindow.
If you don't want any InfoWindow to open, you can set it to null. | [
"Set",
"the",
"InfoWindow",
"to",
"be",
"used",
".",
"Default",
"is",
"a",
"BasicInfoWindow",
"with",
"the",
"layout",
"named",
"bonuspack_bubble",
".",
"You",
"can",
"use",
"this",
"method",
"either",
"to",
"use",
"your",
"own",
"layout",
"or",
"to",
"use... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L144-L150 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java | Polygon.getHoles | public List<List<GeoPoint>> getHoles(){
List<List<GeoPoint>> result = new ArrayList<List<GeoPoint>>(mHoles.size());
for (LinearRing hole:mHoles){
result.add(hole.getPoints());
//TODO: completely wrong:
// hole.getPoints() doesn't return a copy but a direct handler to the internal list.
// - if geodesic,... | java | public List<List<GeoPoint>> getHoles(){
List<List<GeoPoint>> result = new ArrayList<List<GeoPoint>>(mHoles.size());
for (LinearRing hole:mHoles){
result.add(hole.getPoints());
//TODO: completely wrong:
// hole.getPoints() doesn't return a copy but a direct handler to the internal list.
// - if geodesic,... | [
"public",
"List",
"<",
"List",
"<",
"GeoPoint",
">",
">",
"getHoles",
"(",
")",
"{",
"List",
"<",
"List",
"<",
"GeoPoint",
">>",
"result",
"=",
"new",
"ArrayList",
"<",
"List",
"<",
"GeoPoint",
">",
">",
"(",
"mHoles",
".",
"size",
"(",
")",
")",
... | returns a copy of the holes this polygon contains
@return never null | [
"returns",
"a",
"copy",
"of",
"the",
"holes",
"this",
"polygon",
"contains"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L185-L194 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java | Polygon.pointsAsCircle | public static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters){
ArrayList<GeoPoint> circlePoints = new ArrayList<GeoPoint>(360/6);
for (int f = 0; f < 360; f += 6){
GeoPoint onCircle = center.destinationPoint(radiusInMeters, f);
circlePoints.add(onCircle);
}
return circlePoints;
... | java | public static ArrayList<GeoPoint> pointsAsCircle(GeoPoint center, double radiusInMeters){
ArrayList<GeoPoint> circlePoints = new ArrayList<GeoPoint>(360/6);
for (int f = 0; f < 360; f += 6){
GeoPoint onCircle = center.destinationPoint(radiusInMeters, f);
circlePoints.add(onCircle);
}
return circlePoints;
... | [
"public",
"static",
"ArrayList",
"<",
"GeoPoint",
">",
"pointsAsCircle",
"(",
"GeoPoint",
"center",
",",
"double",
"radiusInMeters",
")",
"{",
"ArrayList",
"<",
"GeoPoint",
">",
"circlePoints",
"=",
"new",
"ArrayList",
"<",
"GeoPoint",
">",
"(",
"360",
"/",
... | Build a list of GeoPoint as a circle.
@param center center of the circle
@param radiusInMeters
@return the list of GeoPoint | [
"Build",
"a",
"list",
"of",
"GeoPoint",
"as",
"a",
"circle",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L201-L208 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java | Polygon.setDefaultInfoWindowLocation | protected void setDefaultInfoWindowLocation() {
int s = mOutline.getPoints().size();
if (s == 0){
mInfoWindowLocation = new GeoPoint(0.0, 0.0);
return;
}
//TODO: as soon as the polygon bounding box will be a class member, don't compute it again here.
mInfoWindowLocation = mOutline.getCenter(null);
} | java | protected void setDefaultInfoWindowLocation() {
int s = mOutline.getPoints().size();
if (s == 0){
mInfoWindowLocation = new GeoPoint(0.0, 0.0);
return;
}
//TODO: as soon as the polygon bounding box will be a class member, don't compute it again here.
mInfoWindowLocation = mOutline.getCenter(null);
} | [
"protected",
"void",
"setDefaultInfoWindowLocation",
"(",
")",
"{",
"int",
"s",
"=",
"mOutline",
".",
"getPoints",
"(",
")",
".",
"size",
"(",
")",
";",
"if",
"(",
"s",
"==",
"0",
")",
"{",
"mInfoWindowLocation",
"=",
"new",
"GeoPoint",
"(",
"0.0",
","... | Internal method used to ensure that the infowindow will have a default position in all cases,
so that the user can call showInfoWindow even if no tap occured before.
Currently, set the position on the center of the polygon bounding box. | [
"Internal",
"method",
"used",
"to",
"ensure",
"that",
"the",
"infowindow",
"will",
"have",
"a",
"default",
"position",
"in",
"all",
"cases",
"so",
"that",
"the",
"user",
"can",
"call",
"showInfoWindow",
"even",
"if",
"no",
"tap",
"occured",
"before",
".",
... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polygon.java#L335-L343 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.toPixelsFromProjected | @Deprecated
public Point toPixelsFromProjected(final PointL in, final Point reuse) {
final Point out = reuse != null ? reuse : new Point();
final double power = getProjectedPowerDifference();
final PointL tmp = new PointL();
getLongPixelsFromProjected(in, power, true, tmp);
out.x = TileSystem.truncateToInt(t... | java | @Deprecated
public Point toPixelsFromProjected(final PointL in, final Point reuse) {
final Point out = reuse != null ? reuse : new Point();
final double power = getProjectedPowerDifference();
final PointL tmp = new PointL();
getLongPixelsFromProjected(in, power, true, tmp);
out.x = TileSystem.truncateToInt(t... | [
"@",
"Deprecated",
"public",
"Point",
"toPixelsFromProjected",
"(",
"final",
"PointL",
"in",
",",
"final",
"Point",
"reuse",
")",
"{",
"final",
"Point",
"out",
"=",
"reuse",
"!=",
"null",
"?",
"reuse",
":",
"new",
"Point",
"(",
")",
";",
"final",
"double... | Performs the second computationally light part of the projection.
@param in
the PointL calculated by the {@link #toProjectedPixels(double, double, PointL)}
@param reuse
just pass null if you do not have a Point to be 'recycled'.
@return the Point containing the coordinates of the initial GeoPoint passed to the
{@link ... | [
"Performs",
"the",
"second",
"computationally",
"light",
"part",
"of",
"the",
"projection",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L291-L300 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.unrotateAndScalePoint | public Point unrotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
} | java | public Point unrotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mUnrotateAndScaleMatrix, mOrientation != 0);
} | [
"public",
"Point",
"unrotateAndScalePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"reuse",
")",
"{",
"return",
"applyMatrixToPoint",
"(",
"x",
",",
"y",
",",
"reuse",
",",
"mUnrotateAndScaleMatrix",
",",
"mOrientation",
"!=",
"0",
")",
";",
"}"
] | This will revert the current map's scaling and rotation for a point. This can be useful when
drawing to a fixed location on the screen. | [
"This",
"will",
"revert",
"the",
"current",
"map",
"s",
"scaling",
"and",
"rotation",
"for",
"a",
"point",
".",
"This",
"can",
"be",
"useful",
"when",
"drawing",
"to",
"a",
"fixed",
"location",
"on",
"the",
"screen",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L366-L368 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.rotateAndScalePoint | public Point rotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0);
} | java | public Point rotateAndScalePoint(int x, int y, Point reuse) {
return applyMatrixToPoint(x, y, reuse, mRotateAndScaleMatrix, mOrientation != 0);
} | [
"public",
"Point",
"rotateAndScalePoint",
"(",
"int",
"x",
",",
"int",
"y",
",",
"Point",
"reuse",
")",
"{",
"return",
"applyMatrixToPoint",
"(",
"x",
",",
"y",
",",
"reuse",
",",
"mRotateAndScaleMatrix",
",",
"mOrientation",
"!=",
"0",
")",
";",
"}"
] | This will apply the current map's scaling and rotation for a point. This can be useful when
converting MotionEvents to a screen point. | [
"This",
"will",
"apply",
"the",
"current",
"map",
"s",
"scaling",
"and",
"rotation",
"for",
"a",
"point",
".",
"This",
"can",
"be",
"useful",
"when",
"converting",
"MotionEvents",
"to",
"a",
"screen",
"point",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L374-L376 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.adjustOffsets | public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) {
if (pPixel == null) {
return;
}
final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null);
final Point unRotatedActualPixel = toPixels(pGeoPoint, null);
final long deltaX = unRotatedExpectedPixe... | java | public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) {
if (pPixel == null) {
return;
}
final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null);
final Point unRotatedActualPixel = toPixels(pGeoPoint, null);
final long deltaX = unRotatedExpectedPixe... | [
"public",
"void",
"adjustOffsets",
"(",
"final",
"IGeoPoint",
"pGeoPoint",
",",
"final",
"PointF",
"pPixel",
")",
"{",
"if",
"(",
"pPixel",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"Point",
"unRotatedExpectedPixel",
"=",
"unrotateAndScalePoint",
"(... | Adjust the offsets so that this geo point projects into that pixel
@since 6.0.0 | [
"Adjust",
"the",
"offsets",
"so",
"that",
"this",
"geo",
"point",
"projects",
"into",
"that",
"pixel"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L687-L696 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.adjustOffsets | @Deprecated
public void adjustOffsets(final BoundingBox pBoundingBox) {
if (pBoundingBox == null) {
return;
}
adjustOffsets(pBoundingBox.getLonWest(), pBoundingBox.getLonEast(), false, 0);
adjustOffsets(pBoundingBox.getActualNorth(), pBoundingBox.getActualSouth(), true, 0);
} | java | @Deprecated
public void adjustOffsets(final BoundingBox pBoundingBox) {
if (pBoundingBox == null) {
return;
}
adjustOffsets(pBoundingBox.getLonWest(), pBoundingBox.getLonEast(), false, 0);
adjustOffsets(pBoundingBox.getActualNorth(), pBoundingBox.getActualSouth(), true, 0);
} | [
"@",
"Deprecated",
"public",
"void",
"adjustOffsets",
"(",
"final",
"BoundingBox",
"pBoundingBox",
")",
"{",
"if",
"(",
"pBoundingBox",
"==",
"null",
")",
"{",
"return",
";",
"}",
"adjustOffsets",
"(",
"pBoundingBox",
".",
"getLonWest",
"(",
")",
",",
"pBoun... | Adjust the offsets so that
either this bounding box is bigger than the screen and contains it
or it is smaller and it is centered
@since 6.0.0
@deprecated Use {@link #adjustOffsets(double, double, boolean, int)} instead | [
"Adjust",
"the",
"offsets",
"so",
"that",
"either",
"this",
"bounding",
"box",
"is",
"bigger",
"than",
"the",
"screen",
"and",
"contains",
"it",
"or",
"it",
"is",
"smaller",
"and",
"it",
"is",
"centered"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L705-L712 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/QuadTreeTileSource.java | QuadTreeTileSource.quadTree | protected String quadTree(final long pMapTileIndex) {
final StringBuilder quadKey = new StringBuilder();
for (int i = MapTileIndex.getZoom(pMapTileIndex); i > 0; i--) {
int digit = 0;
final int mask = 1 << (i - 1);
if ((MapTileIndex.getX(pMapTileIndex) & mask) != 0)
digit += 1;
if ((MapTileIndex.get... | java | protected String quadTree(final long pMapTileIndex) {
final StringBuilder quadKey = new StringBuilder();
for (int i = MapTileIndex.getZoom(pMapTileIndex); i > 0; i--) {
int digit = 0;
final int mask = 1 << (i - 1);
if ((MapTileIndex.getX(pMapTileIndex) & mask) != 0)
digit += 1;
if ((MapTileIndex.get... | [
"protected",
"String",
"quadTree",
"(",
"final",
"long",
"pMapTileIndex",
")",
"{",
"final",
"StringBuilder",
"quadKey",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"MapTileIndex",
".",
"getZoom",
"(",
"pMapTileIndex",
")",
";",
... | Converts TMS tile coordinates to QuadTree
@param pMapTileIndex
The tile coordinates to convert
@return The QuadTree as String. | [
"Converts",
"TMS",
"tile",
"coordinates",
"to",
"QuadTree"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/QuadTreeTileSource.java#L26-L39 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java | MapTileProviderBase.mapTileRequestFailed | @Override
public void mapTileRequestFailed(final MapTileRequestState pState) {
if (mTileNotFoundImage!=null) {
putTileIntoCache(pState.getMapTile(), mTileNotFoundImage, ExpirableBitmapDrawable.NOT_FOUND);
for (final Handler handler : mTileRequestCompleteHandlers) {
if (handler != null) {
handler.send... | java | @Override
public void mapTileRequestFailed(final MapTileRequestState pState) {
if (mTileNotFoundImage!=null) {
putTileIntoCache(pState.getMapTile(), mTileNotFoundImage, ExpirableBitmapDrawable.NOT_FOUND);
for (final Handler handler : mTileRequestCompleteHandlers) {
if (handler != null) {
handler.send... | [
"@",
"Override",
"public",
"void",
"mapTileRequestFailed",
"(",
"final",
"MapTileRequestState",
"pState",
")",
"{",
"if",
"(",
"mTileNotFoundImage",
"!=",
"null",
")",
"{",
"putTileIntoCache",
"(",
"pState",
".",
"getMapTile",
"(",
")",
",",
"mTileNotFoundImage",
... | Called by implementation class methods indicating that they have failed to retrieve the
requested map tile. a MAPTILE_FAIL_ID message is sent.
@param pState
the map tile request state object | [
"Called",
"by",
"implementation",
"class",
"methods",
"indicating",
"that",
"they",
"have",
"failed",
"to",
"retrieve",
"the",
"requested",
"map",
"tile",
".",
"a",
"MAPTILE_FAIL_ID",
"message",
"is",
"sent",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L173-L193 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java | MapTileProviderBase.mapTileRequestExpiredTile | @Override
public void mapTileRequestExpiredTile(MapTileRequestState pState, Drawable pDrawable) {
putTileIntoCache(pState.getMapTile(), pDrawable, ExpirableBitmapDrawable.getState(pDrawable));
// tell our caller we've finished and it should update its view
for (final Handler handler : mTileRequestCompleteHandle... | java | @Override
public void mapTileRequestExpiredTile(MapTileRequestState pState, Drawable pDrawable) {
putTileIntoCache(pState.getMapTile(), pDrawable, ExpirableBitmapDrawable.getState(pDrawable));
// tell our caller we've finished and it should update its view
for (final Handler handler : mTileRequestCompleteHandle... | [
"@",
"Override",
"public",
"void",
"mapTileRequestExpiredTile",
"(",
"MapTileRequestState",
"pState",
",",
"Drawable",
"pDrawable",
")",
"{",
"putTileIntoCache",
"(",
"pState",
".",
"getMapTile",
"(",
")",
",",
"pDrawable",
",",
"ExpirableBitmapDrawable",
".",
"getS... | Called by implementation class methods indicating that they have produced an expired result
that can be used but better results may be delivered later. The tile is added to the cache,
and a MAPTILE_SUCCESS_ID message is sent.
@param pState
the map tile request state object
@param pDrawable
the Drawable of the map tile | [
"Called",
"by",
"implementation",
"class",
"methods",
"indicating",
"that",
"they",
"have",
"produced",
"an",
"expired",
"result",
"that",
"can",
"be",
"used",
"but",
"better",
"results",
"may",
"be",
"delivered",
"later",
".",
"The",
"tile",
"is",
"added",
... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L217-L231 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java | MapTileProviderBase.rescaleCache | public void rescaleCache(final Projection pProjection, final double pNewZoomLevel,
final double pOldZoomLevel, final Rect pViewPort) {
if (TileSystem.getInputTileZoomLevel(pNewZoomLevel) == TileSystem.getInputTileZoomLevel(pOldZoomLevel)) {
return;
}
final long startMs = System.currentTimeMillis();
if (... | java | public void rescaleCache(final Projection pProjection, final double pNewZoomLevel,
final double pOldZoomLevel, final Rect pViewPort) {
if (TileSystem.getInputTileZoomLevel(pNewZoomLevel) == TileSystem.getInputTileZoomLevel(pOldZoomLevel)) {
return;
}
final long startMs = System.currentTimeMillis();
if (... | [
"public",
"void",
"rescaleCache",
"(",
"final",
"Projection",
"pProjection",
",",
"final",
"double",
"pNewZoomLevel",
",",
"final",
"double",
"pOldZoomLevel",
",",
"final",
"Rect",
"pViewPort",
")",
"{",
"if",
"(",
"TileSystem",
".",
"getInputTileZoomLevel",
"(",
... | Recreate the cache using scaled versions of the tiles currently in it
@param pNewZoomLevel the zoom level that we need now
@param pOldZoomLevel the previous zoom level that we should get the tiles to rescale
@param pViewPort the view port we need tiles for | [
"Recreate",
"the",
"cache",
"using",
"scaled",
"versions",
"of",
"the",
"tiles",
"currently",
"in",
"it"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileProviderBase.java#L319-L344 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java | ItemizedOverlay.onDrawItem | protected boolean onDrawItem(final Canvas canvas, final Item item, final Point curScreenCoords,
final Projection pProjection) {
final int state = (mDrawFocusedItem && (mFocusedItem == item) ? OverlayItem.ITEM_STATE_FOCUSED_MASK
: 0);
final Drawable marker = (item.getMarker(state) == null) ? getDefaultMa... | java | protected boolean onDrawItem(final Canvas canvas, final Item item, final Point curScreenCoords,
final Projection pProjection) {
final int state = (mDrawFocusedItem && (mFocusedItem == item) ? OverlayItem.ITEM_STATE_FOCUSED_MASK
: 0);
final Drawable marker = (item.getMarker(state) == null) ? getDefaultMa... | [
"protected",
"boolean",
"onDrawItem",
"(",
"final",
"Canvas",
"canvas",
",",
"final",
"Item",
"item",
",",
"final",
"Point",
"curScreenCoords",
",",
"final",
"Projection",
"pProjection",
")",
"{",
"final",
"int",
"state",
"=",
"(",
"mDrawFocusedItem",
"&&",
"(... | Draws an item located at the provided screen coordinates to the canvas.
@param canvas
what the item is drawn upon
@param item
the item to be drawn
@param curScreenCoords
@param pProjection
@return true if the item was actually drawn | [
"Draws",
"an",
"item",
"located",
"at",
"the",
"provided",
"screen",
"coordinates",
"to",
"the",
"canvas",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L197-L230 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java | ItemizedOverlay.getDisplayedItems | public List<Item> getDisplayedItems() {
final List<Item> result = new ArrayList<>();
if (mInternalItemDisplayedList == null) {
return result;
}
for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) {
if (mInternalItemDisplayedList[i]) {
result.add(getItem(i));
}
}
return result;
} | java | public List<Item> getDisplayedItems() {
final List<Item> result = new ArrayList<>();
if (mInternalItemDisplayedList == null) {
return result;
}
for (int i = 0 ; i < mInternalItemDisplayedList.length ; i ++) {
if (mInternalItemDisplayedList[i]) {
result.add(getItem(i));
}
}
return result;
} | [
"public",
"List",
"<",
"Item",
">",
"getDisplayedItems",
"(",
")",
"{",
"final",
"List",
"<",
"Item",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"mInternalItemDisplayedList",
"==",
"null",
")",
"{",
"return",
"result",
";",
... | Get the list of all the items that are currently drawn on the canvas.
The obvious use case is a "share" or "export" button on a map, restricted to what is displayed.
The order of the items is kept
@since 5.6.7
@return the items that have actually been drawn | [
"Get",
"the",
"list",
"of",
"all",
"the",
"items",
"that",
"are",
"currently",
"drawn",
"on",
"the",
"canvas",
".",
"The",
"obvious",
"use",
"case",
"is",
"a",
"share",
"or",
"export",
"button",
"on",
"a",
"map",
"restricted",
"to",
"what",
"is",
"disp... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L240-L251 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java | ItemizedOverlay.calculateItemRect | protected Rect calculateItemRect(Item item, Point coords, Rect reuse) {
final Rect out = reuse != null ? reuse : new Rect();
HotspotPlace hotspot = item.getMarkerHotspot();
if (hotspot == null) {
hotspot = HotspotPlace.BOTTOM_CENTER;
}
final int state = (mDrawFocusedItem && (mFocusedItem == item) ? Overl... | java | protected Rect calculateItemRect(Item item, Point coords, Rect reuse) {
final Rect out = reuse != null ? reuse : new Rect();
HotspotPlace hotspot = item.getMarkerHotspot();
if (hotspot == null) {
hotspot = HotspotPlace.BOTTOM_CENTER;
}
final int state = (mDrawFocusedItem && (mFocusedItem == item) ? Overl... | [
"protected",
"Rect",
"calculateItemRect",
"(",
"Item",
"item",
",",
"Point",
"coords",
",",
"Rect",
"reuse",
")",
"{",
"final",
"Rect",
"out",
"=",
"reuse",
"!=",
"null",
"?",
"reuse",
":",
"new",
"Rect",
"(",
")",
";",
"HotspotPlace",
"hotspot",
"=",
... | Calculates the screen rect for an item.
@param item
@param coords
@param reuse
@return | [
"Calculates",
"the",
"screen",
"rect",
"for",
"an",
"item",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedOverlay.java#L404-L481 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/HeatMap.java | HeatMap.createPolygon | private Overlay createPolygon(BoundingBox key, Integer value, int redthreshold, int orangethreshold) {
Polygon polygon = new Polygon(mMapView);
if (value < orangethreshold)
polygon.setFillColor(Color.parseColor(alpha + yellow));
else if (value < redthreshold)
polygon.setF... | java | private Overlay createPolygon(BoundingBox key, Integer value, int redthreshold, int orangethreshold) {
Polygon polygon = new Polygon(mMapView);
if (value < orangethreshold)
polygon.setFillColor(Color.parseColor(alpha + yellow));
else if (value < redthreshold)
polygon.setF... | [
"private",
"Overlay",
"createPolygon",
"(",
"BoundingBox",
"key",
",",
"Integer",
"value",
",",
"int",
"redthreshold",
",",
"int",
"orangethreshold",
")",
"{",
"Polygon",
"polygon",
"=",
"new",
"Polygon",
"(",
"mMapView",
")",
";",
"if",
"(",
"value",
"<",
... | converts the bounding box into a color filled polygon
@param key
@param value
@param redthreshold
@param orangethreshold
@return | [
"converts",
"the",
"bounding",
"box",
"into",
"a",
"color",
"filled",
"polygon"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/HeatMap.java#L289-L312 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java | SegmentClipper.isInClipArea | public boolean isInClipArea(final long pX, final long pY) {
return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax;
} | java | public boolean isInClipArea(final long pX, final long pY) {
return pX > mXMin && pX < mXMax && pY > mYMin && pY < mYMax;
} | [
"public",
"boolean",
"isInClipArea",
"(",
"final",
"long",
"pX",
",",
"final",
"long",
"pY",
")",
"{",
"return",
"pX",
">",
"mXMin",
"&&",
"pX",
"<",
"mXMax",
"&&",
"pY",
">",
"mYMin",
"&&",
"pY",
"<",
"mYMax",
";",
"}"
] | Check if a point is in the clip area | [
"Check",
"if",
"a",
"point",
"is",
"in",
"the",
"clip",
"area"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L161-L163 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java | SegmentClipper.intersection | private boolean intersection(
final long pX0, final long pY0, final long pX1, final long pY1,
final long pX2, final long pY2, final long pX3, final long pY3
) {
return SegmentIntersection.intersection(
pX0, pY0, pX1, pY1,
pX2, pY2, pX3, pY3, mOptimInte... | java | private boolean intersection(
final long pX0, final long pY0, final long pX1, final long pY1,
final long pX2, final long pY2, final long pX3, final long pY3
) {
return SegmentIntersection.intersection(
pX0, pY0, pX1, pY1,
pX2, pY2, pX3, pY3, mOptimInte... | [
"private",
"boolean",
"intersection",
"(",
"final",
"long",
"pX0",
",",
"final",
"long",
"pY0",
",",
"final",
"long",
"pX1",
",",
"final",
"long",
"pY1",
",",
"final",
"long",
"pX2",
",",
"final",
"long",
"pY2",
",",
"final",
"long",
"pX3",
",",
"final... | Intersection of two segments | [
"Intersection",
"of",
"two",
"segments"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L187-L194 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java | SegmentClipper.intersection | private boolean intersection(final long pX0, final long pY0, final long pX1, final long pY1) {
return intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax) // x min segment
|| intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax) // x max segment
|| intersection(pX0... | java | private boolean intersection(final long pX0, final long pY0, final long pX1, final long pY1) {
return intersection(pX0, pY0, pX1, pY1, mXMin, mYMin, mXMin, mYMax) // x min segment
|| intersection(pX0, pY0, pX1, pY1, mXMax, mYMin, mXMax, mYMax) // x max segment
|| intersection(pX0... | [
"private",
"boolean",
"intersection",
"(",
"final",
"long",
"pX0",
",",
"final",
"long",
"pY0",
",",
"final",
"long",
"pX1",
",",
"final",
"long",
"pY1",
")",
"{",
"return",
"intersection",
"(",
"pX0",
",",
"pY0",
",",
"pX1",
",",
"pY1",
",",
"mXMin",
... | Intersection of a segment with the 4 segments of the clip area | [
"Intersection",
"of",
"a",
"segment",
"with",
"the",
"4",
"segments",
"of",
"the",
"clip",
"area"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L199-L204 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java | SegmentClipper.getClosestCorner | private int getClosestCorner(final long pX0, final long pY0, final long pX1, final long pY1) {
double min = Double.MAX_VALUE;
int corner = 0;
for (int i = 0 ; i < cornerX.length ; i ++) {
final double distance = Distance.getSquaredDistanceToSegment(
cornerX[i], co... | java | private int getClosestCorner(final long pX0, final long pY0, final long pX1, final long pY1) {
double min = Double.MAX_VALUE;
int corner = 0;
for (int i = 0 ; i < cornerX.length ; i ++) {
final double distance = Distance.getSquaredDistanceToSegment(
cornerX[i], co... | [
"private",
"int",
"getClosestCorner",
"(",
"final",
"long",
"pX0",
",",
"final",
"long",
"pY0",
",",
"final",
"long",
"pX1",
",",
"final",
"long",
"pY1",
")",
"{",
"double",
"min",
"=",
"Double",
".",
"MAX_VALUE",
";",
"int",
"corner",
"=",
"0",
";",
... | Gets the clip area corner which is the closest to the given segment
@since 6.0.0
We have a clip area and we have a segment with no intersection with this clip area.
The question is: how do we clip this segment?
If we only clip both segment ends, we may end up with a (min,min) x (max,max)
clip approximation that display... | [
"Gets",
"the",
"clip",
"area",
"corner",
"which",
"is",
"the",
"closest",
"to",
"the",
"given",
"segment"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentClipper.java#L220-L233 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapController.java | MapController.animateTo | @Override
public void animateTo(int x, int y) {
// If no layout, delay this call
if (!mMapView.isLayoutOccurred()) {
mReplayController.animateTo(x, y);
return;
}
if (!mMapView.isAnimating()) {
mMapView.mIsFlinging = false;
final int xS... | java | @Override
public void animateTo(int x, int y) {
// If no layout, delay this call
if (!mMapView.isLayoutOccurred()) {
mReplayController.animateTo(x, y);
return;
}
if (!mMapView.isAnimating()) {
mMapView.mIsFlinging = false;
final int xS... | [
"@",
"Override",
"public",
"void",
"animateTo",
"(",
"int",
"x",
",",
"int",
"y",
")",
"{",
"// If no layout, delay this call",
"if",
"(",
"!",
"mMapView",
".",
"isLayoutOccurred",
"(",
")",
")",
"{",
"mReplayController",
".",
"animateTo",
"(",
"x",
",",
"... | Start animating the map towards the given point. | [
"Start",
"animating",
"the",
"map",
"towards",
"the",
"given",
"point",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L189-L210 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapController.java | MapController.setCenter | @Override
public void setCenter(final IGeoPoint point) {
// If no layout, delay this call
if (!mMapView.isLayoutOccurred()) {
mReplayController.setCenter(point);
return;
}
mMapView.setExpectedCenter(point);
} | java | @Override
public void setCenter(final IGeoPoint point) {
// If no layout, delay this call
if (!mMapView.isLayoutOccurred()) {
mReplayController.setCenter(point);
return;
}
mMapView.setExpectedCenter(point);
} | [
"@",
"Override",
"public",
"void",
"setCenter",
"(",
"final",
"IGeoPoint",
"point",
")",
"{",
"// If no layout, delay this call",
"if",
"(",
"!",
"mMapView",
".",
"isLayoutOccurred",
"(",
")",
")",
"{",
"mReplayController",
".",
"setCenter",
"(",
"point",
")",
... | Set the map view to the given center. There will be no animation. | [
"Set",
"the",
"map",
"view",
"to",
"the",
"given",
"center",
".",
"There",
"will",
"be",
"no",
"animation",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L220-L228 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapController.java | MapController.stopAnimation | @Override
public void stopAnimation(final boolean jumpToTarget) {
if (!mMapView.getScroller().isFinished()) {
if (jumpToTarget) {
mMapView.mIsFlinging = false;
mMapView.getScroller().abortAnimation();
} else
stopPanning();
}
... | java | @Override
public void stopAnimation(final boolean jumpToTarget) {
if (!mMapView.getScroller().isFinished()) {
if (jumpToTarget) {
mMapView.mIsFlinging = false;
mMapView.getScroller().abortAnimation();
} else
stopPanning();
}
... | [
"@",
"Override",
"public",
"void",
"stopAnimation",
"(",
"final",
"boolean",
"jumpToTarget",
")",
"{",
"if",
"(",
"!",
"mMapView",
".",
"getScroller",
"(",
")",
".",
"isFinished",
"(",
")",
")",
"{",
"if",
"(",
"jumpToTarget",
")",
"{",
"mMapView",
".",
... | Stops a running animation.
@param jumpToTarget | [
"Stops",
"a",
"running",
"animation",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapController.java#L241-L267 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.runCleanupOperation | public void runCleanupOperation() {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
if (Configuration.getInstance().isDebugMode()) {
Log.d(IMapView.LOGTAG, "Finished init thread, aborted due to null database reference");
}
return;
... | java | public void runCleanupOperation() {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
if (Configuration.getInstance().isDebugMode()) {
Log.d(IMapView.LOGTAG, "Finished init thread, aborted due to null database reference");
}
return;
... | [
"public",
"void",
"runCleanupOperation",
"(",
")",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"getDb",
"(",
")",
";",
"if",
"(",
"db",
"==",
"null",
"||",
"!",
"db",
".",
"isOpen",
"(",
")",
")",
"{",
"if",
"(",
"Configuration",
".",
"getInstance",
"... | this could be a long running operation, don't run on the UI thread unless necessary.
This function prunes the database for old or expired tiles.
@since 5.6 | [
"this",
"could",
"be",
"a",
"long",
"running",
"operation",
"don",
"t",
"run",
"on",
"the",
"UI",
"thread",
"unless",
"necessary",
".",
"This",
"function",
"prunes",
"the",
"database",
"for",
"old",
"or",
"expired",
"tiles",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L99-L122 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.exists | public boolean exists(final String pTileSource, final long pMapTileIndex) {
return 1 == getRowCount(primaryKey, getPrimaryKeyParameters(getIndex(pMapTileIndex), pTileSource));
} | java | public boolean exists(final String pTileSource, final long pMapTileIndex) {
return 1 == getRowCount(primaryKey, getPrimaryKeyParameters(getIndex(pMapTileIndex), pTileSource));
} | [
"public",
"boolean",
"exists",
"(",
"final",
"String",
"pTileSource",
",",
"final",
"long",
"pMapTileIndex",
")",
"{",
"return",
"1",
"==",
"getRowCount",
"(",
"primaryKey",
",",
"getPrimaryKeyParameters",
"(",
"getIndex",
"(",
"pMapTileIndex",
")",
",",
"pTileS... | Returns true if the given tile source and tile coordinates exist in the cache
@since 5.6 | [
"Returns",
"true",
"if",
"the",
"given",
"tile",
"source",
"and",
"tile",
"coordinates",
"exist",
"in",
"the",
"cache"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L183-L185 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.purgeCache | public boolean purgeCache() {
final SQLiteDatabase db = getDb();
if (db != null && db.isOpen()) {
try {
db.delete(TABLE, null, null);
return true;
} catch (Exception e) {
Log.w(IMapView.LOGTAG, "Error purging the db", e);
... | java | public boolean purgeCache() {
final SQLiteDatabase db = getDb();
if (db != null && db.isOpen()) {
try {
db.delete(TABLE, null, null);
return true;
} catch (Exception e) {
Log.w(IMapView.LOGTAG, "Error purging the db", e);
... | [
"public",
"boolean",
"purgeCache",
"(",
")",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"getDb",
"(",
")",
";",
"if",
"(",
"db",
"!=",
"null",
"&&",
"db",
".",
"isOpen",
"(",
")",
")",
"{",
"try",
"{",
"db",
".",
"delete",
"(",
"TABLE",
",",
"nul... | purges and deletes everything from the cache database
@return
@since 5.6 | [
"purges",
"and",
"deletes",
"everything",
"from",
"the",
"cache",
"database"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L209-L221 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.remove | @Override
public boolean remove(final ITileSource pTileSourceInfo, final long pMapTileIndex) {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
Log.d(IMapView.LOGTAG, "Unable to delete cached tile from " + pTileSourceInfo.name() + " " + MapTileIndex.toString(pMapTileI... | java | @Override
public boolean remove(final ITileSource pTileSourceInfo, final long pMapTileIndex) {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
Log.d(IMapView.LOGTAG, "Unable to delete cached tile from " + pTileSourceInfo.name() + " " + MapTileIndex.toString(pMapTileI... | [
"@",
"Override",
"public",
"boolean",
"remove",
"(",
"final",
"ITileSource",
"pTileSourceInfo",
",",
"final",
"long",
"pMapTileIndex",
")",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"getDb",
"(",
")",
";",
"if",
"(",
"db",
"==",
"null",
"||",
"!",
"db",
... | Removes a specific tile from the cache
@since 5.6 | [
"Removes",
"a",
"specific",
"tile",
"from",
"the",
"cache"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L382-L402 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.getRowCount | public long getRowCount(String tileSourceName) {
if (tileSourceName == null) {
return getRowCount(null, null);
}
return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName});
} | java | public long getRowCount(String tileSourceName) {
if (tileSourceName == null) {
return getRowCount(null, null);
}
return getRowCount(COLUMN_PROVIDER + "=?", new String[] {tileSourceName});
} | [
"public",
"long",
"getRowCount",
"(",
"String",
"tileSourceName",
")",
"{",
"if",
"(",
"tileSourceName",
"==",
"null",
")",
"{",
"return",
"getRowCount",
"(",
"null",
",",
"null",
")",
";",
"}",
"return",
"getRowCount",
"(",
"COLUMN_PROVIDER",
"+",
"\"=?\"",... | Returns the number of tiles in the cache for the specified tile source name
@param tileSourceName
@return
@since 5.6 | [
"Returns",
"the",
"number",
"of",
"tiles",
"in",
"the",
"cache",
"for",
"the",
"specified",
"tile",
"source",
"name"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L411-L416 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.getRowCount | public long getRowCount(final String pTileSourceName, final int pZoom,
final Collection<Rect> pInclude, final Collection<Rect> pExclude) {
return getRowCount(
getWhereClause(pZoom, pInclude, pExclude)
+ (pTileSourceName != null ? " and " + COLU... | java | public long getRowCount(final String pTileSourceName, final int pZoom,
final Collection<Rect> pInclude, final Collection<Rect> pExclude) {
return getRowCount(
getWhereClause(pZoom, pInclude, pExclude)
+ (pTileSourceName != null ? " and " + COLU... | [
"public",
"long",
"getRowCount",
"(",
"final",
"String",
"pTileSourceName",
",",
"final",
"int",
"pZoom",
",",
"final",
"Collection",
"<",
"Rect",
">",
"pInclude",
",",
"final",
"Collection",
"<",
"Rect",
">",
"pExclude",
")",
"{",
"return",
"getRowCount",
"... | Count cache tiles
@param pTileSourceName the tile source name (possibly null)
@param pZoom the zoom level
@param pInclude a collection of bounding boxes to include (possibly null/empty)
@param pExclude a collection of bounding boxes to exclude (possibly null/empty)
@since 6.0.2
@return the number of corresponding tiles... | [
"Count",
"cache",
"tiles"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L456-L462 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.getFirstExpiry | public long getFirstExpiry() {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
return 0;
}
try {
Cursor cursor = db.rawQuery("select min(" + COLUMN_EXPIRES + ") from " + TABLE, null);
cursor.moveToFirst();
long time = c... | java | public long getFirstExpiry() {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
return 0;
}
try {
Cursor cursor = db.rawQuery("select min(" + COLUMN_EXPIRES + ") from " + TABLE, null);
cursor.moveToFirst();
long time = c... | [
"public",
"long",
"getFirstExpiry",
"(",
")",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"getDb",
"(",
")",
";",
"if",
"(",
"db",
"==",
"null",
"||",
"!",
"db",
".",
"isOpen",
"(",
")",
")",
"{",
"return",
"0",
";",
"}",
"try",
"{",
"Cursor",
"cu... | Returns the expiry time of the tile that expires first. | [
"Returns",
"the",
"expiry",
"time",
"of",
"the",
"tile",
"that",
"expires",
"first",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L474-L490 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.getIndex | public static long getIndex(final long pMapTileIndex) {
return getIndex(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), MapTileIndex.getZoom(pMapTileIndex));
} | java | public static long getIndex(final long pMapTileIndex) {
return getIndex(MapTileIndex.getX(pMapTileIndex), MapTileIndex.getY(pMapTileIndex), MapTileIndex.getZoom(pMapTileIndex));
} | [
"public",
"static",
"long",
"getIndex",
"(",
"final",
"long",
"pMapTileIndex",
")",
"{",
"return",
"getIndex",
"(",
"MapTileIndex",
".",
"getX",
"(",
"pMapTileIndex",
")",
",",
"MapTileIndex",
".",
"getY",
"(",
"pMapTileIndex",
")",
",",
"MapTileIndex",
".",
... | Gets the single column index value for a map tile
Unluckily, "map tile index" and "sql pk" don't match
@since 5.6.5
@param pMapTileIndex | [
"Gets",
"the",
"single",
"column",
"index",
"value",
"for",
"a",
"map",
"tile",
"Unluckily",
"map",
"tile",
"index",
"and",
"sql",
"pk",
"don",
"t",
"match"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L527-L529 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java | SqlTileWriter.delete | public long delete(final String pTileSourceName, final int pZoom,
final Collection<Rect> pInclude, final Collection<Rect> pExclude) {
try {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
return -1;
}
ret... | java | public long delete(final String pTileSourceName, final int pZoom,
final Collection<Rect> pInclude, final Collection<Rect> pExclude) {
try {
final SQLiteDatabase db = getDb();
if (db == null || !db.isOpen()) {
return -1;
}
ret... | [
"public",
"long",
"delete",
"(",
"final",
"String",
"pTileSourceName",
",",
"final",
"int",
"pZoom",
",",
"final",
"Collection",
"<",
"Rect",
">",
"pInclude",
",",
"final",
"Collection",
"<",
"Rect",
">",
"pExclude",
")",
"{",
"try",
"{",
"final",
"SQLiteD... | Delete cache tiles
@since 6.0.2
@param pTileSourceName the tile source name (possibly null)
@param pZoom the zoom level
@param pInclude a collection of bounding boxes to include (possibly null/empty)
@param pExclude a collection of bounding boxes to exclude (possibly null/empty)
@return the number of corresponding tile... | [
"Delete",
"cache",
"tiles"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/SqlTileWriter.java#L908-L923 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java | MultiTouchController.onTouchEvent | @SuppressWarnings("unused")
public boolean onTouchEvent(MotionEvent event) {
try {
int pointerCount = multiTouchSupported ? (Integer) m_getPointerCount.invoke(event) : 1;
if (DEBUG)
Log.i("MultiTouch", "Got here 1 - " + multiTouchSupported + " " + mMode + " " + handleSingleTouchEvents + " " + pointerCount)... | java | @SuppressWarnings("unused")
public boolean onTouchEvent(MotionEvent event) {
try {
int pointerCount = multiTouchSupported ? (Integer) m_getPointerCount.invoke(event) : 1;
if (DEBUG)
Log.i("MultiTouch", "Got here 1 - " + multiTouchSupported + " " + mMode + " " + handleSingleTouchEvents + " " + pointerCount)... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"boolean",
"onTouchEvent",
"(",
"MotionEvent",
"event",
")",
"{",
"try",
"{",
"int",
"pointerCount",
"=",
"multiTouchSupported",
"?",
"(",
"Integer",
")",
"m_getPointerCount",
".",
"invoke",
"(",
"event"... | Process incoming touch events | [
"Process",
"incoming",
"touch",
"events"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/metalev/multitouch/controller/MultiTouchController.java#L250-L311 | train |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/tiles/raster/GeoPackageMapTileModuleProvider.java | GeoPackageMapTileModuleProvider.getTileSources | public List<GeopackageRasterTileSource> getTileSources() {
List<GeopackageRasterTileSource> srcs = new ArrayList<>();
List<String> databases = manager.databases();
for (int i = 0; i < databases.size(); i++) {
GeoPackage open = manager.open(databases.get(i));
List<String... | java | public List<GeopackageRasterTileSource> getTileSources() {
List<GeopackageRasterTileSource> srcs = new ArrayList<>();
List<String> databases = manager.databases();
for (int i = 0; i < databases.size(); i++) {
GeoPackage open = manager.open(databases.get(i));
List<String... | [
"public",
"List",
"<",
"GeopackageRasterTileSource",
">",
"getTileSources",
"(",
")",
"{",
"List",
"<",
"GeopackageRasterTileSource",
">",
"srcs",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"List",
"<",
"String",
">",
"databases",
"=",
"manager",
".",
"da... | returns ALL available raster tile sources for all "imported" geopackage databases
@return | [
"returns",
"ALL",
"available",
"raster",
"tile",
"sources",
"for",
"all",
"imported",
"geopackage",
"databases"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/tiles/raster/GeoPackageMapTileModuleProvider.java#L119-L143 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java | ClickableIconOverlay.set | public ClickableIconOverlay set(int id, IGeoPoint position, Drawable icon, DataType data) {
set(position, icon);
mId = id;
mData = data;
return this;
} | java | public ClickableIconOverlay set(int id, IGeoPoint position, Drawable icon, DataType data) {
set(position, icon);
mId = id;
mData = data;
return this;
} | [
"public",
"ClickableIconOverlay",
"set",
"(",
"int",
"id",
",",
"IGeoPoint",
"position",
",",
"Drawable",
"icon",
",",
"DataType",
"data",
")",
"{",
"set",
"(",
"position",
",",
"icon",
")",
";",
"mId",
"=",
"id",
";",
"mData",
"=",
"data",
";",
"retur... | used to recycle this | [
"used",
"to",
"recycle",
"this"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ClickableIconOverlay.java#L44-L49 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/utils/JSONParser.java | JSONParser.makeHttpRequest | public JSONObject makeHttpRequest(String url) throws IOException {
InputStream is = null;
JSONObject jObj = null;
String json = null;
// Making HTTP request
try {
is = new URL(url).openStream();
} catch (Exception ex) {
Log.d("Networking", ex.g... | java | public JSONObject makeHttpRequest(String url) throws IOException {
InputStream is = null;
JSONObject jObj = null;
String json = null;
// Making HTTP request
try {
is = new URL(url).openStream();
} catch (Exception ex) {
Log.d("Networking", ex.g... | [
"public",
"JSONObject",
"makeHttpRequest",
"(",
"String",
"url",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"null",
";",
"JSONObject",
"jObj",
"=",
"null",
";",
"String",
"json",
"=",
"null",
";",
"// Making HTTP request",
"try",
"{",
"is",
... | by making HTTP POST or GET method | [
"by",
"making",
"HTTP",
"POST",
"or",
"GET",
"method"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/utils/JSONParser.java#L33-L78 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java | BoundingBox.getCenterLongitude | public static double getCenterLongitude(final double pWest, final double pEast) {
double longitude = (pEast + pWest) / 2.0;
if (pEast < pWest) {
// center is on the other side of earth
longitude += 180;
}
return org.osmdroid.views.MapView.getTileSystem().cleanLongitude(longitude);
} | java | public static double getCenterLongitude(final double pWest, final double pEast) {
double longitude = (pEast + pWest) / 2.0;
if (pEast < pWest) {
// center is on the other side of earth
longitude += 180;
}
return org.osmdroid.views.MapView.getTileSystem().cleanLongitude(longitude);
} | [
"public",
"static",
"double",
"getCenterLongitude",
"(",
"final",
"double",
"pWest",
",",
"final",
"double",
"pEast",
")",
"{",
"double",
"longitude",
"=",
"(",
"pEast",
"+",
"pWest",
")",
"/",
"2.0",
";",
"if",
"(",
"pEast",
"<",
"pWest",
")",
"{",
"/... | Compute the center of two longitudes
Taking into account the case when "west is on the right and east is on the left"
@since 6.0.0 | [
"Compute",
"the",
"center",
"of",
"two",
"longitudes",
"Taking",
"into",
"account",
"the",
"case",
"when",
"west",
"is",
"on",
"the",
"right",
"and",
"east",
"is",
"on",
"the",
"left"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L143-L150 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java | BoundingBox.increaseByScale | public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) {
if (pBoundingboxPaddingRelativeScale <= 0)
throw new IllegalArgumentException("pBoundingboxPaddingRelativeScale must be positive");
final TileSystem tileSystem = org.osmdroid.views.MapView.getTileSystem();
... | java | public BoundingBox increaseByScale(final float pBoundingboxPaddingRelativeScale) {
if (pBoundingboxPaddingRelativeScale <= 0)
throw new IllegalArgumentException("pBoundingboxPaddingRelativeScale must be positive");
final TileSystem tileSystem = org.osmdroid.views.MapView.getTileSystem();
... | [
"public",
"BoundingBox",
"increaseByScale",
"(",
"final",
"float",
"pBoundingboxPaddingRelativeScale",
")",
"{",
"if",
"(",
"pBoundingboxPaddingRelativeScale",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"pBoundingboxPaddingRelativeScale must be positive\... | Scale this bounding box by a given factor.
@param pBoundingboxPaddingRelativeScale
scale factor
@return scaled bounding box | [
"Scale",
"this",
"bounding",
"box",
"by",
"a",
"given",
"factor",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/BoundingBox.java#L251-L266 | train |
osmdroid/osmdroid | GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java | MapsActivity.onMapReady | @Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.n... | java | @Override
public void onMapReady(GoogleMap googleMap) {
mMap = googleMap;
// Add a marker in Sydney and move the camera
LatLng sydney = new LatLng(-34, 151);
mMap.addMarker(new MarkerOptions().position(sydney).title("Marker in Sydney"));
mMap.moveCamera(CameraUpdateFactory.n... | [
"@",
"Override",
"public",
"void",
"onMapReady",
"(",
"GoogleMap",
"googleMap",
")",
"{",
"mMap",
"=",
"googleMap",
";",
"// Add a marker in Sydney and move the camera",
"LatLng",
"sydney",
"=",
"new",
"LatLng",
"(",
"-",
"34",
",",
"151",
")",
";",
"mMap",
".... | Manipulates the map once available.
This callback is triggered when the map is ready to be used.
This is where we can add markers or lines, add listeners or move the camera. In this case,
we just add a marker near Sydney, Australia.
If Google Play services is not installed on the device, the user will be prompted to in... | [
"Manipulates",
"the",
"map",
"once",
"available",
".",
"This",
"callback",
"is",
"triggered",
"when",
"the",
"map",
"is",
"ready",
"to",
"be",
"used",
".",
"This",
"is",
"where",
"we",
"can",
"add",
"markers",
"or",
"lines",
"add",
"listeners",
"or",
"mo... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/GoogleWrapperSample/src/main/java/org/osmdroid/google/sample/MapsActivity.java#L37-L45 | train |
osmdroid/osmdroid | osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java | WMSParser.parse | public static WMSEndpoint parse(InputStream inputStream) throws Exception {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
dBuilder.setEntityResolver(new EntityResolver() {
@Override
pub... | java | public static WMSEndpoint parse(InputStream inputStream) throws Exception {
DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder dBuilder = dbFactory.newDocumentBuilder();
dBuilder.setEntityResolver(new EntityResolver() {
@Override
pub... | [
"public",
"static",
"WMSEndpoint",
"parse",
"(",
"InputStream",
"inputStream",
")",
"throws",
"Exception",
"{",
"DocumentBuilderFactory",
"dbFactory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"DocumentBuilder",
"dBuilder",
"=",
"dbFactory",
".... | note, the input stream remains open after calling this method, closing it is the caller's problem
@param inputStream
@return
@throws Exception | [
"note",
"the",
"input",
"stream",
"remains",
"open",
"after",
"calling",
"this",
"method",
"closing",
"it",
"is",
"the",
"caller",
"s",
"problem"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-wms/src/main/java/org/osmdroid/wms/WMSParser.java#L52-L78 | train |
osmdroid/osmdroid | osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java | MapFactory.isGoogleMapsV2Supported | public static boolean isGoogleMapsV2Supported(final Context aContext) {
try {
// first check if Google Play Services is available
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(aContext);
if (resultCode == ConnectionResult.SUCCESS) {
// then check if OpenGL ES 2.0 is available
... | java | public static boolean isGoogleMapsV2Supported(final Context aContext) {
try {
// first check if Google Play Services is available
int resultCode = GooglePlayServicesUtil.isGooglePlayServicesAvailable(aContext);
if (resultCode == ConnectionResult.SUCCESS) {
// then check if OpenGL ES 2.0 is available
... | [
"public",
"static",
"boolean",
"isGoogleMapsV2Supported",
"(",
"final",
"Context",
"aContext",
")",
"{",
"try",
"{",
"// first check if Google Play Services is available",
"int",
"resultCode",
"=",
"GooglePlayServicesUtil",
".",
"isGooglePlayServicesAvailable",
"(",
"aContext... | Check whether Google Maps v2 is supported on this device. | [
"Check",
"whether",
"Google",
"Maps",
"v2",
"is",
"supported",
"on",
"this",
"device",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-third-party/src/main/java/org/osmdroid/google/wrapper/v2/MapFactory.java#L61-L75 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java | TileWriter.isSymbolicDirectoryLink | private boolean isSymbolicDirectoryLink(final File pParentDirectory, final File pDirectory) {
try {
final String canonicalParentPath1 = pParentDirectory.getCanonicalPath();
final String canonicalParentPath2 = pDirectory.getCanonicalFile().getParent();
return !canonicalParentPath1.equals(canonicalParentPath2)... | java | private boolean isSymbolicDirectoryLink(final File pParentDirectory, final File pDirectory) {
try {
final String canonicalParentPath1 = pParentDirectory.getCanonicalPath();
final String canonicalParentPath2 = pDirectory.getCanonicalFile().getParent();
return !canonicalParentPath1.equals(canonicalParentPath2)... | [
"private",
"boolean",
"isSymbolicDirectoryLink",
"(",
"final",
"File",
"pParentDirectory",
",",
"final",
"File",
"pDirectory",
")",
"{",
"try",
"{",
"final",
"String",
"canonicalParentPath1",
"=",
"pParentDirectory",
".",
"getCanonicalPath",
"(",
")",
";",
"final",
... | Checks to see if it appears that a directory is a symbolic link. It does this by comparing
the canonical path of the parent directory and the parent directory of the directory's
canonical path. If they are equal, then they come from the same true parent. If not, then
pDirectory is a symbolic link. If we get an exceptio... | [
"Checks",
"to",
"see",
"if",
"it",
"appears",
"that",
"a",
"directory",
"is",
"a",
"symbolic",
"link",
".",
"It",
"does",
"this",
"by",
"comparing",
"the",
"canonical",
"path",
"of",
"the",
"parent",
"directory",
"and",
"the",
"parent",
"directory",
"of",
... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java#L229-L242 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java | TileWriter.cutCurrentCache | private void cutCurrentCache() {
final File lock=Configuration.getInstance().getOsmdroidTileCache();
synchronized (lock) {
if (mUsedCacheSpace > Configuration.getInstance().getTileFileSystemCacheTrimBytes()) {
Log.d(IMapView.LOGTAG,"Trimming tile cache from " + mUsedCacheSpace + " to "
+ Configurati... | java | private void cutCurrentCache() {
final File lock=Configuration.getInstance().getOsmdroidTileCache();
synchronized (lock) {
if (mUsedCacheSpace > Configuration.getInstance().getTileFileSystemCacheTrimBytes()) {
Log.d(IMapView.LOGTAG,"Trimming tile cache from " + mUsedCacheSpace + " to "
+ Configurati... | [
"private",
"void",
"cutCurrentCache",
"(",
")",
"{",
"final",
"File",
"lock",
"=",
"Configuration",
".",
"getInstance",
"(",
")",
".",
"getOsmdroidTileCache",
"(",
")",
";",
"synchronized",
"(",
"lock",
")",
"{",
"if",
"(",
"mUsedCacheSpace",
">",
"Configura... | If the cache size is greater than the max then trim it down to the trim level. This method is
synchronized so that only one thread can run it at a time. | [
"If",
"the",
"cache",
"size",
"is",
"greater",
"than",
"the",
"max",
"then",
"trim",
"it",
"down",
"to",
"the",
"trim",
"level",
".",
"This",
"method",
"is",
"synchronized",
"so",
"that",
"only",
"one",
"thread",
"can",
"run",
"it",
"at",
"a",
"time",
... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/TileWriter.java#L266-L304 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java | MapTileApproximater.getTileBitmap | public static Bitmap getTileBitmap(final int pTileSizePx) {
final Bitmap bitmap = BitmapPool.getInstance().obtainSizedBitmapFromPool(pTileSizePx, pTileSizePx);
if (bitmap != null) {
return bitmap;
}
return Bitmap.createBitmap(pTileSizePx, pTileSizePx, Bitmap.Config.ARGB_8888)... | java | public static Bitmap getTileBitmap(final int pTileSizePx) {
final Bitmap bitmap = BitmapPool.getInstance().obtainSizedBitmapFromPool(pTileSizePx, pTileSizePx);
if (bitmap != null) {
return bitmap;
}
return Bitmap.createBitmap(pTileSizePx, pTileSizePx, Bitmap.Config.ARGB_8888)... | [
"public",
"static",
"Bitmap",
"getTileBitmap",
"(",
"final",
"int",
"pTileSizePx",
")",
"{",
"final",
"Bitmap",
"bitmap",
"=",
"BitmapPool",
".",
"getInstance",
"(",
")",
".",
"obtainSizedBitmapFromPool",
"(",
"pTileSizePx",
",",
"pTileSizePx",
")",
";",
"if",
... | Try to get a tile bitmap from the pool, otherwise allocate a new one
@param pTileSizePx
@return | [
"Try",
"to",
"get",
"a",
"tile",
"bitmap",
"from",
"the",
"pool",
"otherwise",
"allocate",
"a",
"new",
"one"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileApproximater.java#L248-L254 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/IISTrackerBase.java | IISTrackerBase.getLocation | private GeoPoint getLocation() {
//sample data
//{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"}
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null && activeNetwork.isConn... | java | private GeoPoint getLocation() {
//sample data
//{"timestamp": 1483742439, "iss_position": {"latitude": "-50.8416", "longitude": "-41.2701"}, "message": "success"}
NetworkInfo activeNetwork = cm.getActiveNetworkInfo();
boolean isConnected = activeNetwork != null && activeNetwork.isConn... | [
"private",
"GeoPoint",
"getLocation",
"(",
")",
"{",
"//sample data",
"//{\"timestamp\": 1483742439, \"iss_position\": {\"latitude\": \"-50.8416\", \"longitude\": \"-41.2701\"}, \"message\": \"success\"}",
"NetworkInfo",
"activeNetwork",
"=",
"cm",
".",
"getActiveNetworkInfo",
"(",
")"... | HTTP callout to get a JSON document that represents the IIS's current location
@return | [
"HTTP",
"callout",
"to",
"get",
"a",
"JSON",
"document",
"that",
"represents",
"the",
"IIS",
"s",
"current",
"location"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/samplefragments/data/IISTrackerBase.java#L169-L194 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java | PathOverlay.addGreatCircle | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
// get the great circle path length in meters
final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint);
// add one point for every 100kms of the great circle path
final int numberOfPoints... | java | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint) {
// get the great circle path length in meters
final int greatCircleLength = (int) startPoint.distanceToAsDouble(endPoint);
// add one point for every 100kms of the great circle path
final int numberOfPoints... | [
"public",
"void",
"addGreatCircle",
"(",
"final",
"GeoPoint",
"startPoint",
",",
"final",
"GeoPoint",
"endPoint",
")",
"{",
"//\tget the great circle path length in meters",
"final",
"int",
"greatCircleLength",
"=",
"(",
"int",
")",
"startPoint",
".",
"distanceToAsDoubl... | Draw a great circle.
Calculate a point for every 100km along the path.
@param startPoint start point of the great circle
@param endPoint end point of the great circle | [
"Draw",
"a",
"great",
"circle",
".",
"Calculate",
"a",
"point",
"for",
"every",
"100km",
"along",
"the",
"path",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L109-L117 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java | PathOverlay.addGreatCircle | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint, final int numberOfPoints) {
// adapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html
// which was adapted from page http://maps.forum.nu/gm_flight_path.html
// convert to radians
final dou... | java | public void addGreatCircle(final GeoPoint startPoint, final GeoPoint endPoint, final int numberOfPoints) {
// adapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html
// which was adapted from page http://maps.forum.nu/gm_flight_path.html
// convert to radians
final dou... | [
"public",
"void",
"addGreatCircle",
"(",
"final",
"GeoPoint",
"startPoint",
",",
"final",
"GeoPoint",
"endPoint",
",",
"final",
"int",
"numberOfPoints",
")",
"{",
"//\tadapted from page http://compastic.blogspot.co.uk/2011/07/how-to-draw-great-circle-on-map-in.html",
"//\twhich w... | Draw a great circle.
@param startPoint start point of the great circle
@param endPoint end point of the great circle
@param numberOfPoints number of points to calculate along the path | [
"Draw",
"a",
"great",
"circle",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L125-L154 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java | PathOverlay.draw | @Override
public void draw(final Canvas canvas, final Projection pj) {
final int size = this.mPoints.size();
if (size < 2) {
// nothing to paint
return;
}
// precompute new points to the intermediate projection.
while (this.mPointsPrecomputed < size) {
final PointL pt = this.mPoints.get(this.mPoin... | java | @Override
public void draw(final Canvas canvas, final Projection pj) {
final int size = this.mPoints.size();
if (size < 2) {
// nothing to paint
return;
}
// precompute new points to the intermediate projection.
while (this.mPointsPrecomputed < size) {
final PointL pt = this.mPoints.get(this.mPoin... | [
"@",
"Override",
"public",
"void",
"draw",
"(",
"final",
"Canvas",
"canvas",
",",
"final",
"Projection",
"pj",
")",
"{",
"final",
"int",
"size",
"=",
"this",
".",
"mPoints",
".",
"size",
"(",
")",
";",
"if",
"(",
"size",
"<",
"2",
")",
"{",
"// not... | This method draws the line. Note - highly optimized to handle long paths, proceed with care.
Should be fine up to 10K points. | [
"This",
"method",
"draws",
"the",
"line",
".",
"Note",
"-",
"highly",
"optimized",
"to",
"handle",
"long",
"paths",
"proceed",
"with",
"care",
".",
"Should",
"be",
"fine",
"up",
"to",
"10K",
"points",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/PathOverlay.java#L200-L271 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java | MyLocationNewOverlay.enableFollowLocation | public void enableFollowLocation() {
mIsFollowing = true;
// set initial location when enabled
if (isMyLocationEnabled()) {
Location location = mMyLocationProvider.getLastKnownLocation();
if (location != null) {
setLocation(location);
}
}
// Update the screen to see changes take effect
if (mM... | java | public void enableFollowLocation() {
mIsFollowing = true;
// set initial location when enabled
if (isMyLocationEnabled()) {
Location location = mMyLocationProvider.getLastKnownLocation();
if (location != null) {
setLocation(location);
}
}
// Update the screen to see changes take effect
if (mM... | [
"public",
"void",
"enableFollowLocation",
"(",
")",
"{",
"mIsFollowing",
"=",
"true",
";",
"// set initial location when enabled",
"if",
"(",
"isMyLocationEnabled",
"(",
")",
")",
"{",
"Location",
"location",
"=",
"mMyLocationProvider",
".",
"getLastKnownLocation",
"(... | Enables "follow" functionality. The map will center on your current location and
automatically scroll as you move. Scrolling the map in the UI will disable. | [
"Enables",
"follow",
"functionality",
".",
"The",
"map",
"will",
"center",
"on",
"your",
"current",
"location",
"and",
"automatically",
"scroll",
"as",
"you",
"move",
".",
"Scrolling",
"the",
"map",
"in",
"the",
"UI",
"will",
"disable",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java#L382-L397 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java | MyLocationNewOverlay.runOnFirstFix | public boolean runOnFirstFix(final Runnable runnable) {
if (mMyLocationProvider != null && mLocation != null) {
new Thread(runnable).start();
return true;
} else {
mRunOnFirstFix.addLast(runnable);
return false;
}
} | java | public boolean runOnFirstFix(final Runnable runnable) {
if (mMyLocationProvider != null && mLocation != null) {
new Thread(runnable).start();
return true;
} else {
mRunOnFirstFix.addLast(runnable);
return false;
}
} | [
"public",
"boolean",
"runOnFirstFix",
"(",
"final",
"Runnable",
"runnable",
")",
"{",
"if",
"(",
"mMyLocationProvider",
"!=",
"null",
"&&",
"mLocation",
"!=",
"null",
")",
"{",
"new",
"Thread",
"(",
"runnable",
")",
".",
"start",
"(",
")",
";",
"return",
... | Queues a runnable to be executed as soon as we have a location fix. If we already have a fix,
we'll execute the runnable immediately and return true. If not, we'll hang on to the runnable
and return false; as soon as we get a location fix, we'll run it in in a new thread. | [
"Queues",
"a",
"runnable",
"to",
"be",
"executed",
"as",
"soon",
"as",
"we",
"have",
"a",
"location",
"fix",
".",
"If",
"we",
"already",
"have",
"a",
"fix",
"we",
"ll",
"execute",
"the",
"runnable",
"immediately",
"and",
"return",
"true",
".",
"If",
"n... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/mylocation/MyLocationNewOverlay.java#L516-L524 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileSqlCacheProvider.java | MapTileSqlCacheProvider.hasTile | public boolean hasTile(final long pMapTileIndex) {
ITileSource tileSource = mTileSource.get();
if (tileSource == null) {
return false;
}
return mWriter.getExpirationTimestamp(tileSource, pMapTileIndex) != null;
} | java | public boolean hasTile(final long pMapTileIndex) {
ITileSource tileSource = mTileSource.get();
if (tileSource == null) {
return false;
}
return mWriter.getExpirationTimestamp(tileSource, pMapTileIndex) != null;
} | [
"public",
"boolean",
"hasTile",
"(",
"final",
"long",
"pMapTileIndex",
")",
"{",
"ITileSource",
"tileSource",
"=",
"mTileSource",
".",
"get",
"(",
")",
";",
"if",
"(",
"tileSource",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"mWriter",
... | returns true if the given tile for the current map source exists in the cache db | [
"returns",
"true",
"if",
"the",
"given",
"tile",
"for",
"the",
"current",
"map",
"source",
"exists",
"in",
"the",
"cache",
"db"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/MapTileSqlCacheProvider.java#L137-L143 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/ManifestUtil.java | ManifestUtil.retrieveKey | public static String retrieveKey(final Context aContext, final String aKey) {
// get the key from the manifest
final PackageManager pm = aContext.getPackageManager();
try {
final ApplicationInfo info = pm.getApplicationInfo(aContext.getPackageName(),
PackageManager.GET_META_DAT... | java | public static String retrieveKey(final Context aContext, final String aKey) {
// get the key from the manifest
final PackageManager pm = aContext.getPackageManager();
try {
final ApplicationInfo info = pm.getApplicationInfo(aContext.getPackageName(),
PackageManager.GET_META_DAT... | [
"public",
"static",
"String",
"retrieveKey",
"(",
"final",
"Context",
"aContext",
",",
"final",
"String",
"aKey",
")",
"{",
"// get the key from the manifest",
"final",
"PackageManager",
"pm",
"=",
"aContext",
".",
"getPackageManager",
"(",
")",
";",
"try",
"{",
... | Retrieve a key from the manifest meta data, or empty string if not found. | [
"Retrieve",
"a",
"key",
"from",
"the",
"manifest",
"meta",
"data",
"or",
"empty",
"string",
"if",
"not",
"found",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/ManifestUtil.java#L17-L38 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.forceLoadTile | public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) {
try {
final Drawable drawable = mTileDownloader.downloadTile(pMapTileIndex, mTileWriter, tileSource);
return drawable != null;
} catch (CantContinueException e) {
return fa... | java | public boolean forceLoadTile(final OnlineTileSourceBase tileSource, final long pMapTileIndex) {
try {
final Drawable drawable = mTileDownloader.downloadTile(pMapTileIndex, mTileWriter, tileSource);
return drawable != null;
} catch (CantContinueException e) {
return fa... | [
"public",
"boolean",
"forceLoadTile",
"(",
"final",
"OnlineTileSourceBase",
"tileSource",
",",
"final",
"long",
"pMapTileIndex",
")",
"{",
"try",
"{",
"final",
"Drawable",
"drawable",
"=",
"mTileDownloader",
".",
"downloadTile",
"(",
"pMapTileIndex",
",",
"mTileWrit... | Actual tile download, regardless of the tile being already present in the cache
@return true if success, false if error
@since 5.6.5 | [
"Actual",
"tile",
"download",
"regardless",
"of",
"the",
"tile",
"being",
"already",
"present",
"in",
"the",
"cache"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L166-L173 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.isTileToBeDownloaded | public boolean isTileToBeDownloaded(final ITileSource pTileSource, final long pMapTileIndex) {
final Long expiration = mTileWriter.getExpirationTimestamp(pTileSource, pMapTileIndex);
if (expiration == null) {
return true;
}
final long now = System.currentTimeMillis();
... | java | public boolean isTileToBeDownloaded(final ITileSource pTileSource, final long pMapTileIndex) {
final Long expiration = mTileWriter.getExpirationTimestamp(pTileSource, pMapTileIndex);
if (expiration == null) {
return true;
}
final long now = System.currentTimeMillis();
... | [
"public",
"boolean",
"isTileToBeDownloaded",
"(",
"final",
"ITileSource",
"pTileSource",
",",
"final",
"long",
"pMapTileIndex",
")",
"{",
"final",
"Long",
"expiration",
"=",
"mTileWriter",
".",
"getExpirationTimestamp",
"(",
"pTileSource",
",",
"pMapTileIndex",
")",
... | "Should we download this tile?", either because it's not cached yet or because it's expired
@since 5.6.5 | [
"Should",
"we",
"download",
"this",
"tile?",
"either",
"because",
"it",
"s",
"not",
"cached",
"yet",
"or",
"because",
"it",
"s",
"expired"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L188-L195 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.getTilesCoverageIterable | static IterableWithSize<Long> getTilesCoverageIterable(final BoundingBox pBB,
final int pZoomMin, final int pZoomMax) {
final MapTileAreaList list = new MapTileAreaList();
for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) {
... | java | static IterableWithSize<Long> getTilesCoverageIterable(final BoundingBox pBB,
final int pZoomMin, final int pZoomMax) {
final MapTileAreaList list = new MapTileAreaList();
for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) {
... | [
"static",
"IterableWithSize",
"<",
"Long",
">",
"getTilesCoverageIterable",
"(",
"final",
"BoundingBox",
"pBB",
",",
"final",
"int",
"pZoomMin",
",",
"final",
"int",
"pZoomMax",
")",
"{",
"final",
"MapTileAreaList",
"list",
"=",
"new",
"MapTileAreaList",
"(",
")... | Iterable returning tiles covered by the bounding box sorted by ascending zoom level
@param pBB the given bounding box
@param pZoomMin the given minimum zoom level
@param pZoomMax the given maximum zoom level
@return the iterable described above | [
"Iterable",
"returning",
"tiles",
"covered",
"by",
"the",
"bounding",
"box",
"sorted",
"by",
"ascending",
"zoom",
"level"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L230-L237 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.getTilesCoverage | public static List<Long> getTilesCoverage(final ArrayList<GeoPoint> pGeoPoints,
final int pZoomMin, final int pZoomMax) {
final List<Long> result = new ArrayList<>();
for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) {
final Coll... | java | public static List<Long> getTilesCoverage(final ArrayList<GeoPoint> pGeoPoints,
final int pZoomMin, final int pZoomMax) {
final List<Long> result = new ArrayList<>();
for (int zoomLevel = pZoomMin; zoomLevel <= pZoomMax; zoomLevel++) {
final Coll... | [
"public",
"static",
"List",
"<",
"Long",
">",
"getTilesCoverage",
"(",
"final",
"ArrayList",
"<",
"GeoPoint",
">",
"pGeoPoints",
",",
"final",
"int",
"pZoomMin",
",",
"final",
"int",
"pZoomMax",
")",
"{",
"final",
"List",
"<",
"Long",
">",
"result",
"=",
... | Computes the theoretical tiles covered by the list of points
@return list of tiles, sorted by ascending zoom level | [
"Computes",
"the",
"theoretical",
"tiles",
"covered",
"by",
"the",
"list",
"of",
"points"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L268-L276 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.downloadAreaAsync | public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax);
task.addCallback(callback);
... | java | public CacheManagerTask downloadAreaAsync(Context ctx, ArrayList<GeoPoint> geoPoints, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), geoPoints, zoomMin, zoomMax);
task.addCallback(callback);
... | [
"public",
"CacheManagerTask",
"downloadAreaAsync",
"(",
"Context",
"ctx",
",",
"ArrayList",
"<",
"GeoPoint",
">",
"geoPoints",
",",
"final",
"int",
"zoomMin",
",",
"final",
"int",
"zoomMax",
",",
"final",
"CacheManagerCallback",
"callback",
")",
"{",
"final",
"C... | Download in background all tiles covered by the GePoints list in osmdroid cache.
@param ctx
@param geoPoints
@param zoomMin
@param zoomMax | [
"Download",
"in",
"background",
"all",
"tiles",
"covered",
"by",
"the",
"GePoints",
"list",
"in",
"osmdroid",
"cache",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L436-L441 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.downloadAreaAsyncNoUI | public CacheManagerTask downloadAreaAsyncNoUI(Context ctx, BoundingBox bb, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), bb, zoomMin, zoomMax);
task.addCallback(callback);
execute(task... | java | public CacheManagerTask downloadAreaAsyncNoUI(Context ctx, BoundingBox bb, final int zoomMin, final int zoomMax, final CacheManagerCallback callback) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), bb, zoomMin, zoomMax);
task.addCallback(callback);
execute(task... | [
"public",
"CacheManagerTask",
"downloadAreaAsyncNoUI",
"(",
"Context",
"ctx",
",",
"BoundingBox",
"bb",
",",
"final",
"int",
"zoomMin",
",",
"final",
"int",
"zoomMax",
",",
"final",
"CacheManagerCallback",
"callback",
")",
"{",
"final",
"CacheManagerTask",
"task",
... | Download in background all tiles of the specified area in osmdroid cache without a user interface.
@param ctx
@param bb
@param zoomMin
@param zoomMax
@since 5.3 | [
"Download",
"in",
"background",
"all",
"tiles",
"of",
"the",
"specified",
"area",
"in",
"osmdroid",
"cache",
"without",
"a",
"user",
"interface",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L467-L472 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.cancelAllJobs | public void cancelAllJobs(){
Iterator<CacheManagerTask> iterator = mPendingTasks.iterator();
while (iterator.hasNext()) {
CacheManagerTask next = iterator.next();
next.cancel(true);
}
mPendingTasks.clear();
} | java | public void cancelAllJobs(){
Iterator<CacheManagerTask> iterator = mPendingTasks.iterator();
while (iterator.hasNext()) {
CacheManagerTask next = iterator.next();
next.cancel(true);
}
mPendingTasks.clear();
} | [
"public",
"void",
"cancelAllJobs",
"(",
")",
"{",
"Iterator",
"<",
"CacheManagerTask",
">",
"iterator",
"=",
"mPendingTasks",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",
")",
"{",
"CacheManagerTask",
"next",
"=",
"it... | cancels all tasks
@since 5.6.3 | [
"cancels",
"all",
"tasks"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L478-L485 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.downloadAreaAsync | public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax);
task.addCallback(getDownloadingDialog(ctx, task));
return execute(task);
... | java | public CacheManagerTask downloadAreaAsync(Context ctx, List<Long> pTiles, final int zoomMin, final int zoomMax) {
final CacheManagerTask task = new CacheManagerTask(this, getDownloadingAction(), pTiles, zoomMin, zoomMax);
task.addCallback(getDownloadingDialog(ctx, task));
return execute(task);
... | [
"public",
"CacheManagerTask",
"downloadAreaAsync",
"(",
"Context",
"ctx",
",",
"List",
"<",
"Long",
">",
"pTiles",
",",
"final",
"int",
"zoomMin",
",",
"final",
"int",
"zoomMax",
")",
"{",
"final",
"CacheManagerTask",
"task",
"=",
"new",
"CacheManagerTask",
"(... | Download in background all tiles of the specified area in osmdroid cache.
@param ctx
@param pTiles
@param zoomMin
@param zoomMax | [
"Download",
"in",
"background",
"all",
"tiles",
"of",
"the",
"specified",
"area",
"in",
"osmdroid",
"cache",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L495-L499 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java | CacheManager.cleanAreaAsync | public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) {
BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin);
return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax);
} | java | public CacheManagerTask cleanAreaAsync(final Context ctx, ArrayList<GeoPoint> geoPoints, int zoomMin, int zoomMax) {
BoundingBox extendedBounds = extendedBoundsFromGeoPoints(geoPoints,zoomMin);
return cleanAreaAsync(ctx, extendedBounds, zoomMin, zoomMax);
} | [
"public",
"CacheManagerTask",
"cleanAreaAsync",
"(",
"final",
"Context",
"ctx",
",",
"ArrayList",
"<",
"GeoPoint",
">",
"geoPoints",
",",
"int",
"zoomMin",
",",
"int",
"zoomMax",
")",
"{",
"BoundingBox",
"extendedBounds",
"=",
"extendedBoundsFromGeoPoints",
"(",
"... | Remove all cached tiles covered by the GeoPoints list.
@param ctx
@param geoPoints
@param zoomMin
@param zoomMax | [
"Remove",
"all",
"cached",
"tiles",
"covered",
"by",
"the",
"GeoPoints",
"list",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/cachemanager/CacheManager.java#L905-L908 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java | MainActivity.updateStoragePrefreneces | public static long updateStoragePrefreneces(Context ctx){
//loads the osmdroid config from the shared preferences object.
//if this is the first time launching this app, all settings are set defaults with one exception,
//the tile cache. the default is the largest write storage partition, which... | java | public static long updateStoragePrefreneces(Context ctx){
//loads the osmdroid config from the shared preferences object.
//if this is the first time launching this app, all settings are set defaults with one exception,
//the tile cache. the default is the largest write storage partition, which... | [
"public",
"static",
"long",
"updateStoragePrefreneces",
"(",
"Context",
"ctx",
")",
"{",
"//loads the osmdroid config from the shared preferences object.",
"//if this is the first time launching this app, all settings are set defaults with one exception,",
"//the tile cache. the default is the... | refreshes the current osmdroid cache paths with user preferences plus soe logic to work around
file system permissions on api23 devices. it's primarily used for out android tests.
@param ctx
@return current cache size in bytes | [
"refreshes",
"the",
"current",
"osmdroid",
"cache",
"paths",
"with",
"user",
"preferences",
"plus",
"soe",
"logic",
"to",
"work",
"around",
"file",
"system",
"permissions",
"on",
"api23",
"devices",
".",
"it",
"s",
"primarily",
"used",
"for",
"out",
"android",... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java#L205-L222 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java | MainActivity.updateStorageInfo | private void updateStorageInfo(){
long cacheSize = updateStoragePrefreneces(this);
//cache management ends here
TextView tv = findViewById(R.id.sdcardstate_value);
final String state = Environment.getExternalStorageState();
boolean mSdCardAvailable = Environment.MEDIA_MOUNTED.... | java | private void updateStorageInfo(){
long cacheSize = updateStoragePrefreneces(this);
//cache management ends here
TextView tv = findViewById(R.id.sdcardstate_value);
final String state = Environment.getExternalStorageState();
boolean mSdCardAvailable = Environment.MEDIA_MOUNTED.... | [
"private",
"void",
"updateStorageInfo",
"(",
")",
"{",
"long",
"cacheSize",
"=",
"updateStoragePrefreneces",
"(",
"this",
")",
";",
"//cache management ends here",
"TextView",
"tv",
"=",
"findViewById",
"(",
"R",
".",
"id",
".",
"sdcardstate_value",
")",
";",
"f... | gets storage state and current cache size | [
"gets",
"storage",
"state",
"and",
"current",
"cache",
"size"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/MainActivity.java#L227-L248 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java | SimpleFastPointOverlay.onSingleTapConfirmed | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
if(!mStyle.mClickable) return false;
float hyp;
Float minHyp = null;
int closest = -1;
Point tmp = new Point();
Projection pj = mapView.getProjection();
for(int i ... | java | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
if(!mStyle.mClickable) return false;
float hyp;
Float minHyp = null;
int closest = -1;
Point tmp = new Point();
Projection pj = mapView.getProjection();
for(int i ... | [
"@",
"Override",
"public",
"boolean",
"onSingleTapConfirmed",
"(",
"final",
"MotionEvent",
"event",
",",
"final",
"MapView",
"mapView",
")",
"{",
"if",
"(",
"!",
"mStyle",
".",
"mClickable",
")",
"return",
"false",
";",
"float",
"hyp",
";",
"Float",
"minHyp"... | Default action on tap is to select the nearest point. | [
"Default",
"action",
"on",
"tap",
"is",
"to",
"select",
"the",
"nearest",
"point",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java#L209-L235 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java | SimpleFastPointOverlay.setSelectedPoint | public void setSelectedPoint(Integer toSelect) {
if(toSelect == null || toSelect < 0 || toSelect >= mPointList.size())
mSelectedPoint = null;
else
mSelectedPoint = toSelect;
} | java | public void setSelectedPoint(Integer toSelect) {
if(toSelect == null || toSelect < 0 || toSelect >= mPointList.size())
mSelectedPoint = null;
else
mSelectedPoint = toSelect;
} | [
"public",
"void",
"setSelectedPoint",
"(",
"Integer",
"toSelect",
")",
"{",
"if",
"(",
"toSelect",
"==",
"null",
"||",
"toSelect",
"<",
"0",
"||",
"toSelect",
">=",
"mPointList",
".",
"size",
"(",
")",
")",
"mSelectedPoint",
"=",
"null",
";",
"else",
"mS... | Sets the highlighted point. App must invalidate the MapView.
@param toSelect The index of the point (zero-based) in the original list. | [
"Sets",
"the",
"highlighted",
"point",
".",
"App",
"must",
"invalidate",
"the",
"MapView",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/simplefastpoint/SimpleFastPointOverlay.java#L241-L246 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaData.java | ImageryMetaData.getInstanceFromJSON | static public ImageryMetaDataResource getInstanceFromJSON(final String a_jsonContent) throws Exception
{
if(a_jsonContent==null) {
throw new Exception("JSON to parse is null");
}
/// response code should be 200 and authorization should be valid (valid BingMap key)
final JSONObject jsonResult = new JSONObj... | java | static public ImageryMetaDataResource getInstanceFromJSON(final String a_jsonContent) throws Exception
{
if(a_jsonContent==null) {
throw new Exception("JSON to parse is null");
}
/// response code should be 200 and authorization should be valid (valid BingMap key)
final JSONObject jsonResult = new JSONObj... | [
"static",
"public",
"ImageryMetaDataResource",
"getInstanceFromJSON",
"(",
"final",
"String",
"a_jsonContent",
")",
"throws",
"Exception",
"{",
"if",
"(",
"a_jsonContent",
"==",
"null",
")",
"{",
"throw",
"new",
"Exception",
"(",
"\"JSON to parse is null\"",
")",
";... | Parse a JSON string containing ImageryMetaData response
@param a_jsonContent the JSON content string
@return ImageryMetaDataResource object containing parsed information
@throws Exception | [
"Parse",
"a",
"JSON",
"string",
"containing",
"ImageryMetaData",
"response"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/tilesource/bing/ImageryMetaData.java#L26-L57 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/ArchiveFileFactory.java | ArchiveFileFactory.registerArchiveFileProvider | public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){
extensionMap.put(fileExtension, provider);
} | java | public static void registerArchiveFileProvider(Class<? extends IArchiveFile> provider, String fileExtension){
extensionMap.put(fileExtension, provider);
} | [
"public",
"static",
"void",
"registerArchiveFileProvider",
"(",
"Class",
"<",
"?",
"extends",
"IArchiveFile",
">",
"provider",
",",
"String",
"fileExtension",
")",
"{",
"extensionMap",
".",
"put",
"(",
"fileExtension",
",",
"provider",
")",
";",
"}"
] | Registers a custom archive file provider
@param provider
@param fileExtension without the dot
@since 5.0 | [
"Registers",
"a",
"custom",
"archive",
"file",
"provider"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/modules/ArchiveFileFactory.java#L43-L45 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java | DefaultConfigurationProvider.load | private static void load(final SharedPreferences pPrefs,
final Map<String, String> pMap, final String pPrefix) {
//potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079
if (pPrefix==null || pMap==null) return;
pMap.clear();
for (final St... | java | private static void load(final SharedPreferences pPrefs,
final Map<String, String> pMap, final String pPrefix) {
//potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079
if (pPrefix==null || pMap==null) return;
pMap.clear();
for (final St... | [
"private",
"static",
"void",
"load",
"(",
"final",
"SharedPreferences",
"pPrefs",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"pMap",
",",
"final",
"String",
"pPrefix",
")",
"{",
"//potential fix for #1079 https://github.com/osmdroid/osmdroid/issues/1079",... | Loading a map from preferences, using a prefix for the prefs keys
@since 5.6.5
@param pPrefs
@param pMap
@param pPrefix | [
"Loading",
"a",
"map",
"from",
"preferences",
"using",
"a",
"prefix",
"for",
"the",
"prefs",
"keys"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java#L416-L427 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java | DefaultConfigurationProvider.save | private static void save(final SharedPreferences pPrefs, final SharedPreferences.Editor pEdit,
final Map<String, String> pMap, final String pPrefix) {
for (final String key : pPrefs.getAll().keySet()) {
if (key.startsWith(pPrefix)) {
pEdit.remove(key);
... | java | private static void save(final SharedPreferences pPrefs, final SharedPreferences.Editor pEdit,
final Map<String, String> pMap, final String pPrefix) {
for (final String key : pPrefs.getAll().keySet()) {
if (key.startsWith(pPrefix)) {
pEdit.remove(key);
... | [
"private",
"static",
"void",
"save",
"(",
"final",
"SharedPreferences",
"pPrefs",
",",
"final",
"SharedPreferences",
".",
"Editor",
"pEdit",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"pMap",
",",
"final",
"String",
"pPrefix",
")",
"{",
"for",
... | Saving a map into preferences, using a prefix for the prefs keys
@since 5.6.5
@param pPrefs
@param pEdit
@param pMap
@param pPrefix | [
"Saving",
"a",
"map",
"into",
"preferences",
"using",
"a",
"prefix",
"for",
"the",
"prefs",
"keys"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/config/DefaultConfigurationProvider.java#L438-L449 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java | CloudmadeUtil.retrieveCloudmadeKey | public static void retrieveCloudmadeKey(final Context aContext) {
mAndroidId = Settings.Secure.getString(aContext.getContentResolver(), Settings.Secure.ANDROID_ID);
// get the key from the manifest
mKey = ManifestUtil.retrieveKey(aContext, CLOUDMADE_KEY);
// if the id hasn't changed then set the token to the... | java | public static void retrieveCloudmadeKey(final Context aContext) {
mAndroidId = Settings.Secure.getString(aContext.getContentResolver(), Settings.Secure.ANDROID_ID);
// get the key from the manifest
mKey = ManifestUtil.retrieveKey(aContext, CLOUDMADE_KEY);
// if the id hasn't changed then set the token to the... | [
"public",
"static",
"void",
"retrieveCloudmadeKey",
"(",
"final",
"Context",
"aContext",
")",
"{",
"mAndroidId",
"=",
"Settings",
".",
"Secure",
".",
"getString",
"(",
"aContext",
".",
"getContentResolver",
"(",
")",
",",
"Settings",
".",
"Secure",
".",
"ANDRO... | Retrieve the key from the manifest and store it for later use. | [
"Retrieve",
"the",
"key",
"from",
"the",
"manifest",
"and",
"store",
"it",
"for",
"later",
"use",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java#L54-L76 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java | CloudmadeUtil.getCloudmadeToken | public static String getCloudmadeToken() {
if (mToken.length() == 0) {
synchronized (mToken) {
// check again because it may have been set while we were blocking
if (mToken.length() == 0) {
final String url = "http://auth.cloudmade.com/token/" + mKey + "?userid=" + mAndroidId;
HttpURLConnection... | java | public static String getCloudmadeToken() {
if (mToken.length() == 0) {
synchronized (mToken) {
// check again because it may have been set while we were blocking
if (mToken.length() == 0) {
final String url = "http://auth.cloudmade.com/token/" + mKey + "?userid=" + mAndroidId;
HttpURLConnection... | [
"public",
"static",
"String",
"getCloudmadeToken",
"(",
")",
"{",
"if",
"(",
"mToken",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"synchronized",
"(",
"mToken",
")",
"{",
"// check again because it may have been set while we were blocking",
"if",
"(",
"mToken",... | Get the token from the Cloudmade server.
@return the token returned from the server, or null if not found | [
"Get",
"the",
"token",
"from",
"the",
"Cloudmade",
"server",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/util/CloudmadeUtil.java#L101-L165 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java | LatLonGridlineOverlay.getStartEndPointsWE | private static double[] getStartEndPointsWE(double west, double east, int zoom) {
double incrementor = getIncrementor(zoom);
//brute force when zoom is less than 10
if (zoom < 10) {
double we_startpoint = Math.floor(west);
double x = 180;
while (x > we_startp... | java | private static double[] getStartEndPointsWE(double west, double east, int zoom) {
double incrementor = getIncrementor(zoom);
//brute force when zoom is less than 10
if (zoom < 10) {
double we_startpoint = Math.floor(west);
double x = 180;
while (x > we_startp... | [
"private",
"static",
"double",
"[",
"]",
"getStartEndPointsWE",
"(",
"double",
"west",
",",
"double",
"east",
",",
"int",
"zoom",
")",
"{",
"double",
"incrementor",
"=",
"getIncrementor",
"(",
"zoom",
")",
";",
"//brute force when zoom is less than 10",
"if",
"(... | gets the start and stop point for a longitude line
@param west
@param east
@param zoom
@return | [
"gets",
"the",
"start",
"and",
"stop",
"point",
"for",
"a",
"longitude",
"line"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java#L337-L389 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java | LatLonGridlineOverlay.setDefaults | public static void setDefaults() {
lineColor = Color.BLACK;
fontColor=Color.WHITE;
backgroundColor=Color.BLACK;
lineWidth = 1f;
fontSizeDp=32;
DEBUG=false;
DEBUG2=false;
} | java | public static void setDefaults() {
lineColor = Color.BLACK;
fontColor=Color.WHITE;
backgroundColor=Color.BLACK;
lineWidth = 1f;
fontSizeDp=32;
DEBUG=false;
DEBUG2=false;
} | [
"public",
"static",
"void",
"setDefaults",
"(",
")",
"{",
"lineColor",
"=",
"Color",
".",
"BLACK",
";",
"fontColor",
"=",
"Color",
".",
"WHITE",
";",
"backgroundColor",
"=",
"Color",
".",
"BLACK",
";",
"lineWidth",
"=",
"1f",
";",
"fontSizeDp",
"=",
"32"... | resets the settings
@since 5.6.3 | [
"resets",
"the",
"settings"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/gridlines/LatLonGridlineOverlay.java#L457-L466 | train |
osmdroid/osmdroid | OpenStreetMapViewer/src/main/java/org/osmdroid/debug/model/SqlTileWriterExt.java | SqlTileWriterExt.getSources | public List<SourceCount> getSources() {
final SQLiteDatabase db = getDb();
List<SourceCount> ret = new ArrayList<>();
if (db == null) {
return ret;
}
Cursor cur = null;
try {
cur = db.rawQuery(
"select "
... | java | public List<SourceCount> getSources() {
final SQLiteDatabase db = getDb();
List<SourceCount> ret = new ArrayList<>();
if (db == null) {
return ret;
}
Cursor cur = null;
try {
cur = db.rawQuery(
"select "
... | [
"public",
"List",
"<",
"SourceCount",
">",
"getSources",
"(",
")",
"{",
"final",
"SQLiteDatabase",
"db",
"=",
"getDb",
"(",
")",
";",
"List",
"<",
"SourceCount",
">",
"ret",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"if",
"(",
"db",
"==",
"null",... | gets all the tiles sources that we have tiles for in the cache database and their counts
@return | [
"gets",
"all",
"the",
"tiles",
"sources",
"that",
"we",
"have",
"tiles",
"for",
"in",
"the",
"cache",
"database",
"and",
"their",
"counts"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/OpenStreetMapViewer/src/main/java/org/osmdroid/debug/model/SqlTileWriterExt.java#L41-L76 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java | Polyline.isCloseTo | public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) {
return getCloseTo(point, tolerance, mapView) != null;
} | java | public boolean isCloseTo(GeoPoint point, double tolerance, MapView mapView) {
return getCloseTo(point, tolerance, mapView) != null;
} | [
"public",
"boolean",
"isCloseTo",
"(",
"GeoPoint",
"point",
",",
"double",
"tolerance",
",",
"MapView",
"mapView",
")",
"{",
"return",
"getCloseTo",
"(",
"point",
",",
"tolerance",
",",
"mapView",
")",
"!=",
"null",
";",
"}"
] | Detection is done is screen coordinates.
@param point
@param tolerance in pixels
@return true if the Polyline is close enough to the point. | [
"Detection",
"is",
"done",
"is",
"screen",
"coordinates",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java#L176-L178 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java | Polyline.setDefaultInfoWindowLocation | protected void setDefaultInfoWindowLocation(){
int s = mOriginalPoints.size();
if (s > 0)
mInfoWindowLocation = mOriginalPoints.get(s/2);
else
mInfoWindowLocation = new GeoPoint(0.0, 0.0);
} | java | protected void setDefaultInfoWindowLocation(){
int s = mOriginalPoints.size();
if (s > 0)
mInfoWindowLocation = mOriginalPoints.get(s/2);
else
mInfoWindowLocation = new GeoPoint(0.0, 0.0);
} | [
"protected",
"void",
"setDefaultInfoWindowLocation",
"(",
")",
"{",
"int",
"s",
"=",
"mOriginalPoints",
".",
"size",
"(",
")",
";",
"if",
"(",
"s",
">",
"0",
")",
"mInfoWindowLocation",
"=",
"mOriginalPoints",
".",
"get",
"(",
"s",
"/",
"2",
")",
";",
... | Internal method used to ensure that the infowindow will have a default position in all cases,
so that the user can call showInfoWindow even if no tap occured before.
Currently, set the position on the "middle" point of the polyline. | [
"Internal",
"method",
"used",
"to",
"ensure",
"that",
"the",
"infowindow",
"will",
"have",
"a",
"default",
"position",
"in",
"all",
"cases",
"so",
"that",
"the",
"user",
"can",
"call",
"showInfoWindow",
"even",
"if",
"no",
"tap",
"occured",
"before",
".",
... | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/Polyline.java#L245-L251 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/MapView.java | MapView.onDetach | public void onDetach() {
this.getOverlayManager().onDetach(this);
mTileProvider.detach();
mOldZoomController.setVisible(false);
if (mZoomController != null) {
mZoomController.onDetach();
}
//https://github.com/osmdroid/osmdroid/issues/390
if (mTileRequestCompleteHandler instanceof SimpleInvalidationHa... | java | public void onDetach() {
this.getOverlayManager().onDetach(this);
mTileProvider.detach();
mOldZoomController.setVisible(false);
if (mZoomController != null) {
mZoomController.onDetach();
}
//https://github.com/osmdroid/osmdroid/issues/390
if (mTileRequestCompleteHandler instanceof SimpleInvalidationHa... | [
"public",
"void",
"onDetach",
"(",
")",
"{",
"this",
".",
"getOverlayManager",
"(",
")",
".",
"onDetach",
"(",
"this",
")",
";",
"mTileProvider",
".",
"detach",
"(",
")",
";",
"mOldZoomController",
".",
"setVisible",
"(",
"false",
")",
";",
"if",
"(",
... | destroys the map view, all references to listeners, all overlays, etc | [
"destroys",
"the",
"map",
"view",
"all",
"references",
"to",
"listeners",
"all",
"overlays",
"etc"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/MapView.java#L1052-L1070 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java | SegmentIntersection.parallelSideEffect | private static boolean parallelSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
if (pXA == pXB) {
return parallelSideEffec... | java | private static boolean parallelSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
if (pXA == pXB) {
return parallelSideEffec... | [
"private",
"static",
"boolean",
"parallelSideEffect",
"(",
"final",
"double",
"pXA",
",",
"final",
"double",
"pYA",
",",
"final",
"double",
"pXB",
",",
"final",
"double",
"pYB",
",",
"final",
"double",
"pXC",
",",
"final",
"double",
"pYC",
",",
"final",
"d... | When the segments are parallels and overlap, the middle of the overlap is considered as the intersection | [
"When",
"the",
"segments",
"are",
"parallels",
"and",
"overlap",
"the",
"middle",
"of",
"the",
"overlap",
"is",
"considered",
"as",
"the",
"intersection"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L47-L72 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java | SegmentIntersection.check | private static boolean check(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection,
final double pXI, final double pYI
) {
if (pXI < Math.min(... | java | private static boolean check(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection,
final double pXI, final double pYI
) {
if (pXI < Math.min(... | [
"private",
"static",
"boolean",
"check",
"(",
"final",
"double",
"pXA",
",",
"final",
"double",
"pYA",
",",
"final",
"double",
"pXB",
",",
"final",
"double",
"pYB",
",",
"final",
"double",
"pXC",
",",
"final",
"double",
"pYC",
",",
"final",
"double",
"pX... | Checks if computed intersection is valid and sets output accordingly
@param pXI intersection x
@param pYI intersection y
@return true if OK | [
"Checks",
"if",
"computed",
"intersection",
"is",
"valid",
"and",
"sets",
"output",
"accordingly"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L85-L108 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java | SegmentIntersection.divisionByZeroSideEffect | private static boolean divisionByZeroSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
return divisionByZeroSideEffectX(pXA, pYA, pXB, ... | java | private static boolean divisionByZeroSideEffect(
final double pXA, final double pYA, final double pXB, final double pYB,
final double pXC, final double pYC, final double pXD, final double pYD,
final PointL pIntersection
) {
return divisionByZeroSideEffectX(pXA, pYA, pXB, ... | [
"private",
"static",
"boolean",
"divisionByZeroSideEffect",
"(",
"final",
"double",
"pXA",
",",
"final",
"double",
"pYA",
",",
"final",
"double",
"pXB",
",",
"final",
"double",
"pYB",
",",
"final",
"double",
"pXC",
",",
"final",
"double",
"pYC",
",",
"final"... | Main intersection formula works only without division by zero | [
"Main",
"intersection",
"formula",
"works",
"only",
"without",
"division",
"by",
"zero"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/util/SegmentIntersection.java#L134-L143 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java | ItemizedIconOverlay.onSingleTapConfirmed | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
return (activateSelectedItems(event, mapView, new ActiveItem() {
@Override
public boolean run(final int index) {
final ItemizedIconOverlay<Item> that = ItemizedIconOverlay.this;
if (that.mOnItemGestureListen... | java | @Override
public boolean onSingleTapConfirmed(final MotionEvent event, final MapView mapView) {
return (activateSelectedItems(event, mapView, new ActiveItem() {
@Override
public boolean run(final int index) {
final ItemizedIconOverlay<Item> that = ItemizedIconOverlay.this;
if (that.mOnItemGestureListen... | [
"@",
"Override",
"public",
"boolean",
"onSingleTapConfirmed",
"(",
"final",
"MotionEvent",
"event",
",",
"final",
"MapView",
"mapView",
")",
"{",
"return",
"(",
"activateSelectedItems",
"(",
"event",
",",
"mapView",
",",
"new",
"ActiveItem",
"(",
")",
"{",
"@"... | Each of these methods performs a item sensitive check. If the item is located its
corresponding method is called. The result of the call is returned.
Helper methods are provided so that child classes may more easily override behavior without
resorting to overriding the ItemGestureListener methods. | [
"Each",
"of",
"these",
"methods",
"performs",
"a",
"item",
"sensitive",
"check",
".",
"If",
"the",
"item",
"is",
"located",
"its",
"corresponding",
"method",
"is",
"called",
".",
"The",
"result",
"of",
"the",
"call",
"is",
"returned",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java#L118-L130 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java | ItemizedIconOverlay.activateSelectedItems | private boolean activateSelectedItems(final MotionEvent event, final MapView mapView,
final ActiveItem task) {
final int eventX = Math.round(event.getX());
final int eventY = Math.round(event.getY());
for (int i = 0; i < this.mItemList.size(); ++i) {
if (isEventOnItem(getItem(i), eventX, eventY, mapView)) {... | java | private boolean activateSelectedItems(final MotionEvent event, final MapView mapView,
final ActiveItem task) {
final int eventX = Math.round(event.getX());
final int eventY = Math.round(event.getY());
for (int i = 0; i < this.mItemList.size(); ++i) {
if (isEventOnItem(getItem(i), eventX, eventY, mapView)) {... | [
"private",
"boolean",
"activateSelectedItems",
"(",
"final",
"MotionEvent",
"event",
",",
"final",
"MapView",
"mapView",
",",
"final",
"ActiveItem",
"task",
")",
"{",
"final",
"int",
"eventX",
"=",
"Math",
".",
"round",
"(",
"event",
".",
"getX",
"(",
")",
... | When a content sensitive action is performed the content item needs to be identified. This
method does that and then performs the assigned task on that item.
@param event
@param mapView
@param task
@return true if event is handled false otherwise | [
"When",
"a",
"content",
"sensitive",
"action",
"is",
"performed",
"the",
"content",
"item",
"needs",
"to",
"be",
"identified",
".",
"This",
"method",
"does",
"that",
"and",
"then",
"performs",
"the",
"assigned",
"task",
"on",
"that",
"item",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/ItemizedIconOverlay.java#L163-L175 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java | MapTileCache.garbageCollection | public void garbageCollection() {
// number of tiles to remove from cache
int toBeRemoved = Integer.MAX_VALUE; // MAX_VALUE for stressed memory case
final int size = mCachedTiles.size();
if (!mStressedMemory) {
toBeRemoved = size - mCapacity;
if (toBeRemoved <= 0) {
return;
}
}
refreshAddition... | java | public void garbageCollection() {
// number of tiles to remove from cache
int toBeRemoved = Integer.MAX_VALUE; // MAX_VALUE for stressed memory case
final int size = mCachedTiles.size();
if (!mStressedMemory) {
toBeRemoved = size - mCapacity;
if (toBeRemoved <= 0) {
return;
}
}
refreshAddition... | [
"public",
"void",
"garbageCollection",
"(",
")",
"{",
"// number of tiles to remove from cache",
"int",
"toBeRemoved",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"// MAX_VALUE for stressed memory case",
"final",
"int",
"size",
"=",
"mCachedTiles",
".",
"size",
"(",
")",
"... | Removes from the memory cache all the tiles that should no longer be there
@since 6.0.0 | [
"Removes",
"from",
"the",
"memory",
"cache",
"all",
"the",
"tiles",
"that",
"should",
"no",
"longer",
"be",
"there"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java#L159-L194 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java | MapTileCache.populateSyncCachedTiles | private void populateSyncCachedTiles(final MapTileList pList) {
synchronized (mCachedTiles) {
pList.ensureCapacity(mCachedTiles.size());
pList.clear();
for (final long index : mCachedTiles.keySet()) {
pList.put(index);
}
}
} | java | private void populateSyncCachedTiles(final MapTileList pList) {
synchronized (mCachedTiles) {
pList.ensureCapacity(mCachedTiles.size());
pList.clear();
for (final long index : mCachedTiles.keySet()) {
pList.put(index);
}
}
} | [
"private",
"void",
"populateSyncCachedTiles",
"(",
"final",
"MapTileList",
"pList",
")",
"{",
"synchronized",
"(",
"mCachedTiles",
")",
"{",
"pList",
".",
"ensureCapacity",
"(",
"mCachedTiles",
".",
"size",
"(",
")",
")",
";",
"pList",
".",
"clear",
"(",
")"... | Just a helper method in order to parse all indices without concurrency side effects
@since 6.0.0 | [
"Just",
"a",
"helper",
"method",
"in",
"order",
"to",
"parse",
"all",
"indices",
"without",
"concurrency",
"side",
"effects"
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/tileprovider/MapTileCache.java#L314-L322 | train |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/InternalCompassOrientationProvider.java | InternalCompassOrientationProvider.startOrientationProvider | @Override
public boolean startOrientationProvider(IOrientationConsumer orientationConsumer)
{
mOrientationConsumer = orientationConsumer;
boolean result = false;
final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
if (sensor != null) {
res... | java | @Override
public boolean startOrientationProvider(IOrientationConsumer orientationConsumer)
{
mOrientationConsumer = orientationConsumer;
boolean result = false;
final Sensor sensor = mSensorManager.getDefaultSensor(Sensor.TYPE_ORIENTATION);
if (sensor != null) {
res... | [
"@",
"Override",
"public",
"boolean",
"startOrientationProvider",
"(",
"IOrientationConsumer",
"orientationConsumer",
")",
"{",
"mOrientationConsumer",
"=",
"orientationConsumer",
";",
"boolean",
"result",
"=",
"false",
";",
"final",
"Sensor",
"sensor",
"=",
"mSensorMan... | Enable orientation updates from the internal compass sensor and show the compass. | [
"Enable",
"orientation",
"updates",
"from",
"the",
"internal",
"compass",
"sensor",
"and",
"show",
"the",
"compass",
"."
] | 3b178b2f078497dd88c137110e87aafe45ad2b16 | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/overlay/compass/InternalCompassOrientationProvider.java#L27-L38 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.