2026-04-13-3
This commit is contained in:
@@ -1,37 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter_map/flutter_map.dart';
|
||||
import 'package:latlong2/latlong.dart';
|
||||
|
||||
class IntaleqMapWidget extends StatelessWidget {
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return FlutterMap(
|
||||
options: MapOptions(
|
||||
initialCenter: LatLng(33.5138, 36.2765), // Damascus / دمشق
|
||||
initialZoom: 13.0,
|
||||
),
|
||||
children: [
|
||||
TileLayer(
|
||||
// هذا هو الرابط الذي يجلب الخريطة من السيرفر الخاص بك!
|
||||
urlTemplate: 'https://app.intaleqapp.com/martin/planet_osm_line/{z}/{x}/{y}.pbf',
|
||||
userAgentPackageName: 'com.intaleq.app',
|
||||
subdomains: const ['a', 'b', 'c'],
|
||||
),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ─────────────────────────────────────────────────────────
|
||||
// Helper Class for API Interaction (Intelligence API)
|
||||
// ─────────────────────────────────────────────────────────
|
||||
class IntaleqApiService {
|
||||
static const String baseUrl = 'https://app.intaleqapp.com/api';
|
||||
static const String apiKey = 'intaleq_secret_2026';
|
||||
|
||||
Future<void> triggerDailyIntelligence() async {
|
||||
// مثال لطلب معالجة البيانات من داخل تطبيق فلاتر (اختياري)
|
||||
print('Triggering 3 AM process manually...');
|
||||
}
|
||||
}
|
||||
@@ -1,69 +0,0 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||
|
||||
// ─────────────────────────────────────────────────────────
|
||||
// Intaleq Vector Map Widget (Professional Setup)
|
||||
// Uses MapLibre GL for High Performance Vector Tiles (.pbf)
|
||||
// ─────────────────────────────────────────────────────────
|
||||
class IntaleqMapWidget extends StatefulWidget {
|
||||
const IntaleqMapWidget({super.key});
|
||||
|
||||
@override
|
||||
State<IntaleqMapWidget> createState() => _IntaleqMapWidgetState();
|
||||
}
|
||||
|
||||
class _IntaleqMapWidgetState extends State<IntaleqMapWidget> {
|
||||
MaplibreMapController? mapController;
|
||||
|
||||
void _onMapCreated(MaplibreMapController controller) {
|
||||
mapController = controller;
|
||||
}
|
||||
|
||||
// Example: Downloading an offline region for caching
|
||||
Future<void> _downloadOfflineRegion() async {
|
||||
final bounds = LatLngBounds(
|
||||
southwest: const LatLng(33.4, 36.1), // Southwest corner of Damascus
|
||||
northeast: const LatLng(33.6, 36.4), // Northeast corner of Damascus
|
||||
);
|
||||
|
||||
// Mapbox/MapLibre has built-in offline caching for vector tiles!
|
||||
// It caches the vectors very efficiently.
|
||||
await downloadOfflineRegion(
|
||||
OfflineRegionDefinition(
|
||||
bounds: bounds,
|
||||
mapStyleUrl: 'https://app.intaleqapp.com/style-mobile.json', // Your custom style linking to .pbf
|
||||
minZoom: 10.0,
|
||||
maxZoom: 16.0,
|
||||
),
|
||||
metadata: {
|
||||
'name': 'Damascus Region',
|
||||
},
|
||||
);
|
||||
print('✅ Offline region downloaded and cached successfully!');
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Scaffold(
|
||||
body: MaplibreMap(
|
||||
onMapCreated: _onMapCreated,
|
||||
initialCameraPosition: const CameraPosition(
|
||||
target: LatLng(33.5138, 36.2765), // Damascus / دمشق
|
||||
zoom: 13.0,
|
||||
),
|
||||
// The style URL points to a JSON file on your server.
|
||||
// This JSON defines colors, line widths, and the tile source (Martin .pbf URLs)
|
||||
styleString: 'https://app.intaleqapp.com/style-mobile.json',
|
||||
|
||||
// Optimizations for smooth vector rendering
|
||||
minMaxZoomPreference: const MinMaxZoomPreference(5, 18),
|
||||
myLocationEnabled: true,
|
||||
),
|
||||
floatingActionButton: FloatingActionButton(
|
||||
onPressed: _downloadOfflineRegion,
|
||||
tooltip: 'Download Offline Map',
|
||||
child: const Icon(Icons.download),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user