Skip to content

Commit

Permalink
Fix NPE error, use https osm on measurement map
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolas-f committed Mar 22, 2019
1 parent 8a6c7a4 commit 93d5560
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ android {
applicationId "org.noise_planet.noisecapture"
minSdkVersion 15
targetSdkVersion 28
versionCode 44
versionName "1.2.8"
versionCode 45
versionName "1.2.9"
// Store build date in apk
buildConfigField "long", "TIMESTAMP", System.currentTimeMillis() + "L"
buildConfigField "String", "GITHASH", "\"${getCheckedOutGitCommitHash().toString()}\""
Expand Down
6 changes: 3 additions & 3 deletions app/src/main/assets/html/map_measurement.html
Original file line number Diff line number Diff line change
Expand Up @@ -101,12 +101,12 @@
minZoom: 14
});

var osm = L.tileLayer('http://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors',
var osm = L.tileLayer('https://a.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png', {
attribution: '&copy; <a href="https://osm.org/copyright">OpenStreetMap</a> contributors',
zIndex: 1
});

var esriworldimagery = L.tileLayer('http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
var esriworldimagery = L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer/tile/{z}/{y}/{x}', {
attribution: 'Tiles &copy; Esri &mdash; Source: Esri, i-cubed, USDA, USGS, AEX, GeoEye, Getmapping, Aerogrid, IGN, IGP, UPR-EGP, and the GIS User Community',
maxZoom: 19
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ public static JSONArray recordsToGeoJSON(List<MeasurementManager.LeqBatch> recor
// Add coordinate
JSONObject point = new JSONObject();
point.put("type", "Point");
if(!Double.isNaN(leq.getAltitude())) {
if(leq.getAltitude() != null && !Double.isNaN(leq.getAltitude())) {
point.put("coordinates", new JSONArray(Arrays.asList(
leq.getLongitude(), leq.getLatitude(), leq.getAltitude())));
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ public boolean onCreateOptionsMenu(Menu menu) {
".html#18/"+String.format(Locale.ROOT, "%.5f",
coordinates[0]) +"/" + String.format(Locale.ROOT, "%.5f",coordinates[1])) + "/";
}
String url = "http://www.twitter.com/intent/tweet?via=Noise_Planet&hashtags="+hashtags.toString() +
String url = "https://www.twitter.com/intent/tweet?via=Noise_Planet&hashtags="+hashtags.toString() +
"&text=" + Uri.encode(getString(R.string.share_message, record.getLeqMean())) +
append;
Intent i = new Intent(Intent.ACTION_VIEW);
Expand Down

0 comments on commit 93d5560

Please sign in to comment.