2026-04-16-3 add secur ,billing ,documents ,
This commit is contained in:
@@ -0,0 +1,49 @@
|
||||
import 'package:maplibre_gl/maplibre_gl.dart';
|
||||
import 'package:http/http.dart' as http;
|
||||
import 'dart:convert';
|
||||
|
||||
class IntaleqMapController {
|
||||
final MapLibreMapController mapController;
|
||||
final String apiKey;
|
||||
|
||||
IntaleqMapController({
|
||||
required this.mapController,
|
||||
required this.apiKey,
|
||||
});
|
||||
|
||||
/// Search for places using Intaleq Geocoding API
|
||||
Future<List<dynamic>> search(String query) async {
|
||||
final response = await http.get(
|
||||
Uri.parse(
|
||||
'https://map-saas.intaleq.com/v1/geocoding/search?q=$query&key=$apiKey'),
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return json.decode(response.body);
|
||||
}
|
||||
throw Exception('Failed to search');
|
||||
}
|
||||
|
||||
/// Get route using Intaleq Routing API
|
||||
Future<Map<String, dynamic>> getRoute(
|
||||
LatLng start,
|
||||
LatLng end, {
|
||||
String profile = 'car',
|
||||
}) async {
|
||||
final response = await http.get(
|
||||
Uri.parse(
|
||||
'https://map-saas.intaleq.com/v1/routing/route?start=${start.longitude},${start.latitude}&end=${end.longitude},${end.latitude}&profile=$profile&key=$apiKey',
|
||||
),
|
||||
);
|
||||
if (response.statusCode == 200) {
|
||||
return json.decode(response.body);
|
||||
}
|
||||
throw Exception('Failed to fetch route');
|
||||
}
|
||||
}
|
||||
|
||||
class IntaleqStyles {
|
||||
static String obsidian(String apiKey) =>
|
||||
'https://maps.intaleq.com/styles/obsidian/style.json?key=$apiKey';
|
||||
static String light(String apiKey) =>
|
||||
'https://maps.intaleq.com/styles/light/style.json?key=$apiKey';
|
||||
}
|
||||
@@ -0,0 +1,22 @@
|
||||
name: intaleq_maps
|
||||
description: Premium Flutter SDK for Intaleq Map Platform (Jordan & Syria).
|
||||
version: 1.0.0
|
||||
homepage: https://intaleq.com
|
||||
|
||||
environment:
|
||||
sdk: ">=3.0.0 <4.0.0"
|
||||
flutter: ">=3.0.0"
|
||||
|
||||
dependencies:
|
||||
flutter:
|
||||
sdk: flutter
|
||||
maplibre_gl: ^0.19.0 # Use standard MapLibre plugin
|
||||
http: ^1.1.0
|
||||
|
||||
dev_dependencies:
|
||||
flutter_test:
|
||||
sdk: flutter
|
||||
lints: ^2.1.0
|
||||
|
||||
flutter:
|
||||
uses-material-design: true
|
||||
@@ -0,0 +1,31 @@
|
||||
{
|
||||
"name": "@intaleq/maps-gl",
|
||||
"version": "1.0.0",
|
||||
"description": "Premium JavaScript SDK for Intaleq Map Platform",
|
||||
"main": "dist/index.js",
|
||||
"module": "dist/index.mjs",
|
||||
"types": "dist/index.d.ts",
|
||||
"scripts": {
|
||||
"build": "tsup src/index.ts --format cjs,esm --dts",
|
||||
"dev": "tsup src/index.ts --format cjs,esm --watch --dts",
|
||||
"lint": "eslint src/**"
|
||||
},
|
||||
"keywords": [
|
||||
"maps",
|
||||
"intaleq",
|
||||
"jordan",
|
||||
"syria",
|
||||
"vector-tiles",
|
||||
"maplibre"
|
||||
],
|
||||
"author": "Intaleq team",
|
||||
"license": "MIT",
|
||||
"peerDependencies": {
|
||||
"maplibre-gl": "^5.1.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"maplibre-gl": "^5.1.1",
|
||||
"tsup": "^8.0.0",
|
||||
"typescript": "^5.0.0"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,61 @@
|
||||
import maplibregl from 'maplibre-gl';
|
||||
|
||||
export interface IntaleqMapOptions extends Omit<maplibregl.MapOptions, 'container'> {
|
||||
container: string | HTMLElement;
|
||||
apiKey: string;
|
||||
styleType?: 'obsidian' | 'light' | 'hybrid';
|
||||
}
|
||||
|
||||
/**
|
||||
* Intaleq Maps JS SDK
|
||||
* Optimized for Jordan & Syria mapping services.
|
||||
*/
|
||||
export class IntaleqMap extends maplibregl.Map {
|
||||
private readonly intaleqApiKey: string;
|
||||
|
||||
constructor(options: IntaleqMapOptions) {
|
||||
const { apiKey, styleType = 'obsidian', ...mapOptions } = options;
|
||||
|
||||
// Construct the Intaleq style URL
|
||||
// In production, this points to our tile server with the API key
|
||||
const styleUrl = `https://maps.intaleq.com/styles/${styleType}/style.json?key=${apiKey}`;
|
||||
|
||||
super({
|
||||
...mapOptions,
|
||||
style: styleUrl,
|
||||
hash: mapOptions.hash ?? true,
|
||||
center: mapOptions.center ?? [35.9239, 31.9522], // Default to Amman
|
||||
zoom: mapOptions.zoom ?? 12,
|
||||
transformRequest: (url: string) => {
|
||||
// Automatically append API key to all tile and asset requests
|
||||
if (url.includes('intaleq.com')) {
|
||||
const separator = url.includes('?') ? '&' : '?';
|
||||
return {
|
||||
url: `${url}${separator}key=${apiKey}`
|
||||
};
|
||||
}
|
||||
return { url };
|
||||
}
|
||||
});
|
||||
|
||||
this.intaleqApiKey = apiKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to search for places using Intaleq Geocoding API
|
||||
*/
|
||||
async search(query: string) {
|
||||
const response = await fetch(`https://map-saas.intaleq.com/v1/geocoding/search?q=${encodeURIComponent(query)}&key=${this.intaleqApiKey}`);
|
||||
return response.json();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper to get routes using Intaleq Routing API
|
||||
*/
|
||||
async getRoute(start: [number, number], end: [number, number], profile: 'car' | 'bike' | 'foot' = 'car') {
|
||||
const response = await fetch(`https://map-saas.intaleq.com/v1/routing/route?start=${start.join(',')}&end=${end.join(',')}&profile=${profile}&key=${this.intaleqApiKey}`);
|
||||
return response.json();
|
||||
}
|
||||
}
|
||||
|
||||
export { maplibregl };
|
||||
Reference in New Issue
Block a user