generated from Grigo/AndroidTemplate
fixed modal
This commit is contained in:
@@ -143,6 +143,7 @@ public class MapFragment extends Fragment {
|
||||
private Bitmap bitmapHill;
|
||||
private Marker hillMarker;
|
||||
private Polyline hillPathLine;
|
||||
private boolean hillActive;
|
||||
private ElevationHeatmapLayer heatmapLayer;
|
||||
private boolean heatmapActive;
|
||||
private int heatmapRadiusM = 100;
|
||||
@@ -204,7 +205,7 @@ public class MapFragment extends Fragment {
|
||||
setupCenterModeToggle();
|
||||
|
||||
if (btnFindHill != null) {
|
||||
btnFindHill.setOnClickListener(v -> findNearestHill());
|
||||
btnFindHill.setOnClickListener(v -> toggleHill());
|
||||
}
|
||||
setupHeatmapUi();
|
||||
|
||||
@@ -879,6 +880,27 @@ public class MapFragment extends Fragment {
|
||||
return null;
|
||||
}
|
||||
|
||||
private void toggleHill() {
|
||||
if (hillActive) {
|
||||
deactivateHill();
|
||||
return;
|
||||
}
|
||||
findNearestHill();
|
||||
}
|
||||
|
||||
private void deactivateHill() {
|
||||
hillActive = false;
|
||||
if (btnFindHill != null) {
|
||||
btnFindHill.setActivated(false);
|
||||
btnFindHill.setEnabled(true);
|
||||
}
|
||||
clearHillLayers();
|
||||
if (mapHillStatus != null) {
|
||||
mapHillStatus.setVisibility(View.GONE);
|
||||
}
|
||||
requestMapInvalidate();
|
||||
}
|
||||
|
||||
private void findNearestHill() {
|
||||
if (uploader == null || !isAdded()) {
|
||||
return;
|
||||
@@ -918,6 +940,10 @@ public class MapFragment extends Fragment {
|
||||
}
|
||||
return;
|
||||
}
|
||||
hillActive = true;
|
||||
if (btnFindHill != null) {
|
||||
btnFindHill.setActivated(true);
|
||||
}
|
||||
showHillOnMap(lat, lon, result);
|
||||
});
|
||||
} catch (Exception e) {
|
||||
@@ -1293,17 +1319,12 @@ public class MapFragment extends Fragment {
|
||||
}
|
||||
|
||||
private boolean centerOnSelf() {
|
||||
if (uploader == null) {
|
||||
LatLong self = resolveSelfPosition();
|
||||
if (self == null) {
|
||||
return false;
|
||||
}
|
||||
String myId = uploader.getDeviceId();
|
||||
for (DeviceInfo d : lastDevices) {
|
||||
if (myId.equals(d.device_id) && GeoUtils.isValidCoordinate(d.lat, d.lon)) {
|
||||
centerOnPoint(new LatLong(d.lat, d.lon), (byte) 14);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
centerOnPoint(self, (byte) 14);
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean centerOnRole(String role) {
|
||||
|
||||
@@ -7,6 +7,7 @@ from typing import Any, Optional
|
||||
from fastapi import FastAPI, Header, HTTPException, Query
|
||||
from fastapi.middleware.cors import CORSMiddleware
|
||||
from fastapi.responses import FileResponse
|
||||
from fastapi.staticfiles import StaticFiles
|
||||
from pydantic import BaseModel, Field
|
||||
|
||||
from core.auth import ANDROID_CLIENT_HEADER, ANDROID_CLIENT_VALUE
|
||||
@@ -370,6 +371,9 @@ def health():
|
||||
}
|
||||
|
||||
|
||||
app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
|
||||
|
||||
@@ -321,6 +321,18 @@
|
||||
</div>
|
||||
<script src="https://unpkg.com/leaflet@1.9.4/dist/leaflet.js"></script>
|
||||
<script src="/static/radio-ui.js"></script>
|
||||
<script>
|
||||
if (typeof RadioUI === 'undefined') {
|
||||
console.error('radio-ui.js not loaded — check /static/radio-ui.js');
|
||||
window.RadioUI = {
|
||||
roleLabel: (role) => role || '—',
|
||||
parseRadioSnapshot: () => ({}),
|
||||
diffSnapshots: () => new Set(),
|
||||
formatRadioPanel: () => '—',
|
||||
renderCompareGrid: () => '—'
|
||||
};
|
||||
}
|
||||
</script>
|
||||
<script>
|
||||
const map = L.map('map').setView([55.75, 37.62], 10);
|
||||
L.tileLayer('https://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', {
|
||||
|
||||
Reference in New Issue
Block a user