This file contains hidden or 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
DecimalFormat df = new DecimalFormat("#.####"); | |
df.setRoundingMode(RoundingMode.CEILING); | |
double newLat = Double.valueOf(df.format(coordinates.latitude)); | |
double newLong = Double.valueOf(df.format(coordinates.longitude)); |
This file contains hidden or 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
@After | |
public void teaddown() { | |
setting.clear(); | |
resetSingleton(ErgoSettings.class, "sInstance"); | |
} | |
public static void resetSingleton(Class clazz, String fieldName) { | |
Field instance; | |
try { |
This file contains hidden or 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 enum CardViewType { | |
SUBSCRIBED(1), | |
REJECTED(2), | |
NEW(3); | |
private int value; | |
private static Map<Integer, CardViewType> map = new HashMap<>(); | |
CardViewType(int value) { | |
this.value = value; |
This file contains hidden or 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
map.zoomControl.removeFrom(map); | |
// create the control | |
var autoZoomCheckbox = L.control({position: 'topleft'}); | |
autoZoomCheckbox.onAdd = function (map) { | |
var div = L.DomUtil.create('div', 'command'); | |
div.innerHTML = '<form><input id="command" type="checkbox"/>Auto fit bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); |
This file contains hidden or 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
//Add center result control button | |
L.easyButton({ | |
states: [{ | |
stateName: 'zoom-to-forest', | |
icon: 'glyphicon glyphicon-screenshot', | |
title: 'Center map to heat results', | |
onClick: function(btn, map) { | |
if (typeof $scope.heatLayer != 'undefined' | |
&& typeof $scope.maxGlobalHeat != 'undefined') { | |
map.setView($scope.maxGlobalHeat, 10); |
This file contains hidden or 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
// create the control | |
var autoZoomCheckbox = L.control({position: 'topleft'}); | |
autoZoomCheckbox.onAdd = function (map) { | |
var div = L.DomUtil.create('div', 'command'); | |
div.innerHTML = '<form><input id="command" type="checkbox"/>Automatic fit to bounds</form>'; | |
return div; | |
}; | |
autoZoomCheckbox.addTo(map); |
This file contains hidden or 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
function addFailedTask(taskID){ | |
if(taskID != null){ | |
$scope.failedTaskList.push(taskID); | |
} | |
$scope.failedTaskList = _.uniq($scope.failedTaskList); | |
} |
This file contains hidden or 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
_calculateOffset: function(bearing_angle, radius){ | |
//Calculate destination point based on bearing and distance | |
//http://www.movable-type.co.uk/scripts/latlong.html | |
var d2r = L.LatLng.DEG_TO_RAD; //simple convert do radians | |
var r2d= L.LatLng.RAD_TO_DEG; //simple convert to degrees | |
var radius = radius/1500; | |
var lat = this._latlng.lat * d2r; | |
var lng = this._latlng.lng * d2r; | |
var angle = bearing_angle * d2r; | |
var R = 6372.795477598; |
This file contains hidden or 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
$scope.excludedTrips = _.reject($scope.excludedTrips, function(objArr){ | |
return objArr.id == event.id; | |
}); |
This file contains hidden or 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
<RelativeLayout | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent"> | |
<de.hdodenhof.circleimageview.CircleImageView | |
android:id="@+id/no_answer_image" | |
android:layout_width="40dp" | |
android:layout_height="40dp" | |
android:layout_alignParentLeft="true" | |
android:layout_marginLeft="5dp" |