This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Megaphone |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class CurrentLocationListener implements LocationListener{ | |
public static double latitude; | |
public static double longitude; | |
@SuppressWarnings("static-access") | |
@Override | |
public void onLocationChanged(Location location) { | |
this.latitude=location.getLatitude(); | |
this.longitude=location.getLongitude(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MapActivity extends SherlockActivity { | |
private LocationManager locationManager; | |
Location location; | |
public void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public double areaPoly(ArrayList<Location> places){ | |
int[] x = new int[places.size()]; | |
int[] y = new int[places.size()]; | |
for (int i = 0; i<places.size(); i++){ | |
x[i] = LocationToEN(places.get(i))[0]; | |
y[i] = LocationToEN(places.get(i))[1]; | |
} | |
double area = 0.0; | |
int j = x.length-1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.mapbox.MapBoxView | |
public class SimpleMapBoxExample extends ApplicationContext { | |
MapBoxView map; | |
protected void onCreate(Bundle savedInstanceState){ | |
super.onCreate(savedInstanceState); | |
// We can initialize the map with the MapBox name, coordinates and zoom level | |
map = new MapBoxView("examples.map-9ijuk24y", 42.65742, 2.347682, 12); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.util.ArrayList; | |
import org.osmdroid.DefaultResourceProxyImpl; | |
import org.osmdroid.api.IMapController; | |
import org.osmdroid.tileprovider.MapTileProviderBasic; | |
import org.osmdroid.tileprovider.tilesource.ITileSource; | |
import org.osmdroid.tileprovider.tilesource.XYTileSource; | |
import org.osmdroid.util.GeoPoint; | |
import org.osmdroid.views.MapView; | |
import org.osmdroid.views.overlay.ItemizedIconOverlay; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"type": "FeatureCollection", | |
"features": [ | |
{ | |
"type": "Feature", | |
"properties": {}, | |
"geometry": { | |
"type": "Point", | |
"coordinates": [ | |
-4.454301595687866, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) { | |
range(0, 100) | |
.mapToObj(i -> randomString(new Random(), 'A', 'Z', 10)) | |
.sorted() | |
.collect(groupingBy(name -> name.charAt(0))) | |
.forEach((letter, names) -> System.out.println(letter + "\n\t" + names.stream().collect(joining("\n\t")))); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<link rel="stylesheet" href="vendor/leaflet.css" /> | |
<style> | |
#map, html, body { | |
width: 100%; height: 100%; padding: 0; margin: 0; | |
} | |
</style> | |
<body> | |
<div id="map"></div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<html> | |
<link rel="stylesheet" href="vendor/leaflet.css" /> | |
<style> | |
#map, html, body { | |
width: 100%; height: 100%; padding: 0; margin: 0; | |
} | |
</style> | |
<body> | |
<div id="map"></div> |
OlderNewer