/** * Documentation Engine for Intaleq Dashboard * Comprehensive API Reference (EN/AR) * Updated with Premium Visuals, High-Performance Examples, and Official SDKs */ const docs = { init: () => { console.log('📚 Intaleq Documentation Module Init'); docs.bindEvents(); // Initial render based on existing active links or default const activeLink = document.querySelector('.docs-nav-link.active'); const section = activeLink ? activeLink.getAttribute('data-section') : 'getting-started'; docs.renderSection(section); }, bindEvents: () => { document.querySelectorAll('.docs-nav-link').forEach(link => { link.addEventListener('click', (e) => { e.preventDefault(); const section = e.currentTarget.getAttribute('data-section'); docs.renderSection(section); // Active state management document.querySelectorAll('.docs-nav-link').forEach(l => l.classList.remove('active', 'bg-blue-500/10', 'text-blue-400')); e.currentTarget.classList.add('active', 'bg-blue-500/10', 'text-blue-400'); }); }); }, renderSection: (id) => { const container = document.getElementById('docs-content'); if (!container) return; const lang = i18n.currentLang || 'en'; const isAr = lang === 'ar'; const content = { 'getting-started': `

${isAr ? 'انطلق في ثوانٍ' : 'Launch in Seconds'}

${isAr ? 'مرحباً بك في مستقبل الخرائط في المنطقة. توفر لك منصة "انطلاق" واجهات برمجية ذكية، خرائط Vector فائقة الدقة، ومباني ثلاثية الأبعاد متكاملة.' : 'Welcome to the future of regional mapping. Intaleq provides high-fidelity vector tiles, intelligent geocoding, and native 3D building support for Jordan & Syria.'}

01

${isAr ? 'مفتاح الوصول' : 'Access Key'}

${isAr ? 'قم بإنشاء مفتاح API من لوحة التحكم لتفعيل طلباتك.' : 'Generate your secure API key from the dashboard to authenticate requests.'}

02

${isAr ? 'تكامل الخريطة' : 'Map Integration'}

${isAr ? 'اختر النمط (Obsidian أو Light) وادمج الخريطة في تطبيقك.' : 'Select a theme and integrate the vector tiles using our GL styles.'}

03

${isAr ? 'بيانات ذكية' : 'Smart Data'}

${isAr ? 'استخدم خدمات البحث والتوجيه لإضافة ذكاء مكاني لتطبيقك.' : 'Leverage Geocoding and Routing APIs for advanced spatial intelligence.'}

${isAr ? 'بيانات الوصول والمصادقة' : 'Domain & Authentication'}

Production URL
https://map-saas.intaleq.com/api

${isAr ? 'طريقة المصادقة' : 'Auth Method'}

${isAr ? 'يتم إرسال المفتاح عبر الـ HTTP Header التالي:' : 'Pass your API key in the following HTTP header:'}

x-api-key

${isAr ? 'نطاق الوصول' : 'Allowed Origins'}

${isAr ? 'تأكد من إضافة النطاق الخاص بك في إعدادات المفتاح.' : 'Ensure your request origin is listed in the key restrictions.'}

`, 'sdks': `

${isAr ? 'المكتبات البرمجية (SDKs)' : 'SDKs & Client Libraries'}

${isAr ? 'استخدم مكتباتنا الجاهزة لدمج الخرائط والخدمات في ثوانٍ.' : 'Accelerate your development with our official enterprise-grade client libraries.'}

Flutter SDK

${isAr ? 'مكتبة متكاملة لنظام Flutter تدعم أندرويد و iOS والويب.' : 'A robust Flutter wrapper for MapLibre with native Intaleq services integrated.'}

# pubspec.yaml
intaleq_maps: ^1.0.0
View on pub.dev

JavaScript SDK

${isAr ? 'مكتبة JavaScript حديثة مدعومة بـ TypeScript لتطبيقات الويب.' : 'Modern TypeScript-ready SDK for seamless web map integration and routing.'}

# Install via NPM
npm i intaleq-maps-gl
View on NPM

${isAr ? 'مثال: إضافة مؤشر (JS SDK)' : 'Example: Adding a Marker (JS SDK)'}

import { IntaleqMap } from 'intaleq-maps-gl';

const map = new IntaleqMap({
    container: 'map',
    apiKey: 'YOUR_KEY',
    styleType: 'obsidian'
});

map.addIntaleqMarker({
    position: [35.91, 31.95], // [lng, lat]
    color: '#0D47A1'
});
`, 'tiles-api': `

${isAr ? 'خرائط الـ Vector' : 'Vector Tiles API'}

${isAr ? 'خرائط تفاعلية فائقة السرعة تدعم العرض ثلاثي الأبعاد والتحكم الكامل في الخصائص.' : 'High-performance interactive maps with native 3D buildings and custom GL styles.'}

GET
/v1/maps/style.json
${isAr ? 'المعاملات المدعومة' : 'Query Parameters'}
theme Optional (obsidian | light)
key Required
${isAr ? 'رابط النمط المباشر' : 'Direct Style URL'}
https://map-saas.intaleq.com/api/v1/maps/style.json?theme=obsidian&key=YOUR_API_KEY
`, 'geocoding-api': `

${isAr ? 'البحث المكاني (Geocoding)' : 'Geocoding API'}

${isAr ? 'حوّل العناوين إلى إحداثيات أو العكس بدقة غير مسبوقة في الأردن وسوريا.' : 'Transform addresses into coordinates or reverse resolve locations with extreme accuracy in the Levant region.'}

SEARCH
/v1/geocoding/search
ParamDescription
qQuery (e.g. "Masjid Hashem")
limitMax results (Default: 5)
Real-World Response
{
  "results": [
    {
      "id": 5843,
      "name": "مسجد هاشم",
      "name_ar": "مسجد هاشم",
      "category": "building",
      "governorate": "الزرقاء",
      "location": { "lat": 32.10659, "lng": 36.18301 },
      "full_address": "لواء قصبة الزرقاء، الزرقاء",
      "distance_km": "12.68",
      "source": "user_place"
    }
  ],
  "source": "cache_hit"
}
`, 'routing-api': `

${isAr ? 'محرك التوجيه (Routing)' : 'Routing Engine'}

${isAr ? 'حساب أسرع المسارات مع تحليلات لحظية لحركة المرور.' : 'Fast pathfinding with traffic-aware duration metrics.'}

ROUTE
/v1/routing/route
Required Parameters
  • start "35.91,31.95"
  • end "35.85,31.82"
  • profile car | bike | foot
Production Response
{
  "distance": 30313.8,
  "duration": 1975,
  "trafficAwareDuration": 1975,
  "points": "_cvbE_th{Ev@iJpHtDLEJKz@^XJn@...",
  "instructions": [
    {
      "text": "Continue onto شارع الأمير الحسن",
      "distance": 172.8,
      "street_name": "شارع الأمير الحسن"
    },
    {
      "text": "اتجه قليلاً لليمين خلال شارع الجيش",
      "distance": 190.1,
      "street_name": "شارع الجيش"
    }
  ]
}
` }; container.innerHTML = content[id] || '
Documentation section coming soon...
'; // Re-initialize icons if (window.lucide) lucide.createIcons(); } }; // Global initializer window.docs = docs;