Commit c8a25def authored by Michael Rauter's avatar Michael Rauter

Merge branch '1.4' into 'master'

1.4

See merge request Maverick/FreifunkKarte!1
parents f2b46a7b 2cd93432
Original Freifunk Karte
=======================
1.4
\ No newline at end of file
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.3"
compileSdkVersion 26
buildToolsVersion '26.0.2'
defaultConfig {
applicationId "de.freifunk_karte.freifunk_karte"
minSdkVersion 15
targetSdkVersion 23
versionCode 4
versionName "1.2"
targetSdkVersion 26
versionCode 7
versionName '1.4'
}
buildTypes {
release {
......@@ -17,11 +16,13 @@ android {
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.3.0'
compile 'com.android.support:support-v4:23.3.0'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:support-v4:26.1.0'
}
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:installLocation="auto"
package="de.freifunk_karte.freifunk_karte">
<uses-permission android:name="android.permission.INTERNET" />
......@@ -11,7 +13,9 @@
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:supportsRtl="true"
android:theme="@style/AppTheme">
android:theme="@style/AppTheme"
android:fullBackupContent="@xml/backup_descriptor"
tools:ignore="GoogleAppIndexingWarning">
<activity
android:name="main"
android:configChanges="orientation|keyboardHidden|screenSize"
......
This diff is collapsed.
......@@ -9,7 +9,7 @@
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/css/bootstrap.min.css">
<link rel="stylesheet" href="https://www.freifunk-karte.de/css/site.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet.css" />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet.css" />
</head>
<body>
<div id="map"></div>
......@@ -65,18 +65,13 @@
<div class="modal-body">
<div style="text-align:center"><img src="https://www.freifunk-karte.de/img/ajax-loader.gif" alt="spinner" /></div>
<p>
Bitte haben Sie einen Moment Geduld. Die Daten werden geladen und unter Umständen neu verarbeitet.
</p>
<p>
Falls Sie bisher gelesen haben werden die Daten tatsächlich neu von allen Communities eingelesen und verarbeitet.
Dies passiert alle 24 Stunden bei einem zufälligen Seitenaufruf.
Das Los ist auf Sie gefallen. Sie haben also gewonnen und sorgen nun so dafür, dass die nächsten Besucher die Karte deutlich schneller sehen werden.
Bitte haben Sie einen Moment Geduld. Die Daten werden geladen.
</p>
<p>
Nach spätestens einer Minute werden Sie die Freifunk-Knoten angezeigt bekommen.
</p>
<p>
Vielen Dank für Ihre Geduld und Mithilfe.
Vielen Dank für Ihre Geduld.
</p>
</div>
</div>
......@@ -85,7 +80,7 @@
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.1/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.3/leaflet-src.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/leaflet/0.7.7/leaflet-src.js"></script>
<script src="file:///android_asset/PruneCluster.js"></script>
<script src="file:///android_asset/heatmap.min.js"></script>
<script src="file:///android_asset/leaflet-heatmap.js"></script>
......@@ -94,9 +89,9 @@
<script src="file:///android_asset/meta_map.js"></script>
<script src="file:///android_asset/site.js"></script>
<script>
var tileServerUrl = "http://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png";
var tileServerUrl = "https://{s}.tile.openstreetmap.de/tiles/osmde/{z}/{x}/{y}.png";
var tileServerAttribution = "&copy; <a href=\"http:\/\/www.openstreetmap.org\/copyright\">OpenStreetMap<\/a>";
var mapInitalView = {"latitude":51.16,"longitude":10.45,"zoom":6};
</script>
</body>
</body>
</html>
......@@ -220,6 +220,15 @@ function addPoints2Map(data)
});
var heatMapData = [];
var heatmapUserLayer = new HeatmapOverlay({
"radius": 50,
"scaleRadius": false,
"useLocalExtrema": false,
"valueField": 'count'
});
var heatMapUserData = [];
// add all entries to clustergroup and heatmap
$.each(data, function(i, router)
{
......@@ -229,6 +238,12 @@ function addPoints2Map(data)
count: 1.1
});
heatMapUserData.push({
lat: router.lat,
lng: router.long,
count: router.clients
});
var marker = new PruneCluster.Marker(router.lat, router.long);
marker.category = 0;
......@@ -261,12 +276,19 @@ function addPoints2Map(data)
data: heatMapData
});
map.addLayer(heatmapUserLayer);
heatmapUserLayer.setData({
max: 1,
data: heatMapUserData
});
var layers = {
// add the cluster layer
"Nodes": pruneCluster,
// add the heatmap layer
"HeatMap": heatmapLayer
"HeatMap Router": heatmapLayer,
"HeatMap User": heatmapUserLayer
};
var selectedLayers = getURLParameter('l');
......@@ -274,6 +296,7 @@ function addPoints2Map(data)
if(selectedLayers)
{
// layers have been preselected in the url
selectedLayers = selectedLayers.replace(/%20/g,' ');
selectedLayers = selectedLayers.split('|');
$.each(layers, function(key, layer)
......@@ -292,6 +315,7 @@ function addPoints2Map(data)
{
// hide heatmap layer by default
map.removeLayer(heatmapLayer);
map.removeLayer(heatmapUserLayer);
}
// add layer controls for all layers
......@@ -564,60 +588,50 @@ function preparePruneCluster()
// +--- Init the prune Cluste Plugin for Leaflet: https://github.com/SINTEF-9012/PruneCluster---------------
var pruneCluster = new PruneClusterForLeaflet();
pruneCluster.BuildLeafletCluster = function(cluster, position)
{
var m = new L.Marker(position,
{
icon: pruneCluster.BuildLeafletClusterIcon(cluster)
});
m.on('click', function()
{
map.removeLayer(clusterArea);
// Compute the cluster bounds (it's slow : O(n))
var markersArea = pruneCluster.Cluster.FindMarkersInArea(cluster.bounds);
var b = pruneCluster.Cluster.ComputeBounds(markersArea);
if (b)
{
var bounds = new L.LatLngBounds(
new L.LatLng(b.minLat, b.maxLng),
new L.LatLng(b.maxLat, b.minLng));
var zoomLevelBefore = pruneCluster._map.getZoom();
var zoomLevelAfter = pruneCluster._map.getBoundsZoom(bounds, false, new L.Point(20, 20, null));
// If the zoom level doesn't change
if (zoomLevelAfter === zoomLevelBefore)
{
// Send an event for the LeafletSpiderfier
pruneCluster._map.fire('overlappingmarkers', {
cluster: pruneCluster,
markers: markersArea,
center: m.getLatLng(),
marker: m
});
pruneCluster._map.setView(position, zoomLevelAfter);
}
else
{
pruneCluster._map.fitBounds(bounds);
}
}
})
.on('mouseover', function()
{
showClusterHull(cluster);
})
.on('mouseout', function()
{
map.removeLayer(clusterArea);
});
return m;
};
pruneCluster.BuildLeafletCluster = function(cluster, position) {
var m = new L.Marker(position, {
icon: pruneCluster.BuildLeafletClusterIcon(cluster)
});
m.on('click', function() {
// Compute the cluster bounds (it's slow : O(n))
var markersArea = pruneCluster.Cluster.FindMarkersInArea(cluster.bounds);
var b = pruneCluster.Cluster.ComputeBounds(markersArea);
if (b) {
var bounds = new L.LatLngBounds(
new L.LatLng(b.minLat, b.maxLng),
new L.LatLng(b.maxLat, b.minLng));
var zoomLevelBefore = pruneCluster._map.getZoom();
var zoomLevelAfter = pruneCluster._map.getBoundsZoom(bounds, false, new L.Point(20, 20, null));
// If the zoom level doesn't change
if (zoomLevelAfter === zoomLevelBefore) {
// Send an event for the LeafletSpiderfier
pruneCluster._map.fire('overlappingmarkers', {
cluster: pruneCluster,
markers: markersArea,
center: m.getLatLng(),
marker: m
});
pruneCluster._map.setView(position, zoomLevelAfter);
}
else {
pruneCluster._map.fitBounds(bounds);
}
}
});
m.on('mouseover', function() {
//do mouseover stuff here
});
m.on('mouseout', function() {
//do mouseout stuff here
});
return m;
};
// + Make a custom Icon for the Cluster. Also Taken from: https://github.com/SINTEF-9012/PruneCluster
pruneCluster.BuildLeafletClusterIcon = function (cluster)
......@@ -631,4 +645,4 @@ function preparePruneCluster()
pruneCluster.Cluster.Size = 100;
return pruneCluster;
}
}
\ No newline at end of file
package de.freifunk_karte.freifunk_karte;
import android.Manifest;
import android.annotation.SuppressLint;
import android.app.Activity;
import android.content.Intent;
import android.content.pm.PackageManager;
......@@ -64,20 +65,21 @@ public class main extends Activity {
// }
}
WebView wv;
private WebView wv;
/** Called when the activity is first created. */
@SuppressLint("SetJavaScriptEnabled")
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Log.d("Test", "Started");
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) == PackageManager.PERMISSION_GRANTED) {
if (ActivityCompat.checkSelfPermission(this, Manifest.permission.ACCESS_FINE_LOCATION) != PackageManager.PERMISSION_GRANTED) {
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.ACCESS_FINE_LOCATION},
ACCESS_FINE_LOCATION_PERMITTED);
}
wv = (WebView) findViewById(R.id.webView);
wv = findViewById(R.id.webView);
// Brower niceties -- pinch / zoom, follow links in place
wv.getSettings().setJavaScriptCanOpenWindowsAutomatically(true);
wv.getSettings().setBuiltInZoomControls(true);
......
......@@ -2,7 +2,6 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="#0099cc"
tools:context="de.freifunk_karte.freifunk_karte.main">
<!-- The primary full-screen view. This can be replaced with whatever view
......
<resources>
<string name="app_name">Freifunk-Karte</string>
<string name="dummy_button">Dummy Button</string>
<string name="dummy_content">DUMMY\nCONTENT</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<full-backup-content>
<!-- Exclude specific shared preferences that contain GCM registration Id -->
</full-backup-content>
......@@ -3,9 +3,10 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.1.0'
classpath 'com.android.tools.build:gradle:3.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
......@@ -15,6 +16,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}
......
#Mon Dec 28 10:00:20 PST 2015
#Thu Feb 22 21:46:04 CET 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.10-all.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment