/** * Documentation Engine for Intaleq Dashboard * Comprehensive API Reference (EN/AR) * Updated with Premium Visuals & High-Performance Examples */ 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.'}

${isAr ? 'حدود الاستخدام (RPM)' : 'Rate Limiting (RPM)'}

Free

5 RPM

Starter

100 RPM

Pro

500 RPM

Enterprise

5000 RPM

`, 'tiles-api': `

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

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

Active V1.2
GET
/v1/maps/style.json
${isAr ? 'المعاملات المدعومة' : 'Query Parameters'}
theme

${isAr ? 'نمط الخريطة (light أو obsidian)' : 'Map visual theme (light | obsidian)'}

Optional
3d

${isAr ? 'تفعيل/إلغاء المباني ثلاثية الأبعاد' : 'Enable/Disable 3D buildings'}

Boolean
${isAr ? 'ملاحظة: يتم استهلاك رصيد الخرائط بناءً على عدد الـ (Tile Requests) التي يتم طلبها أثناء التنقل في الخريطة.' : 'Note: Quota is consumed per tile request. High-density 3D areas may consume more resources.'}
JavaScript (MapLibre)
const map = new maplibregl.Map({
    container: 'map-id',
    style: 'https://map-saas.intaleq.com/api/v1/maps/style.json?theme=obsidian',
    transformRequest: (url) => {
        return {
            url: url,
            headers: { 'x-api-key': 'YOUR_KEY_HERE' }
        }
    }
});
`, '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
${isAr ? 'البارامتر' : 'Key'} ${isAr ? 'الوصف' : 'Description'}
q ${isAr ? 'نص البحث (مثلاً: "عمان، الجبيهة")' : 'Query string (e.g., "Amman, Jordan")'}
limit ${isAr ? 'عدد النتائج (الافتراضي: 5)' : 'Max results limit'}
cURL Fast Access
curl "https://map-saas.intaleq.com/api/v1/geocoding/search?q=Amman" \\
     -H "x-api-key: YOUR_SECURE_KEY"
Response Structure application/json
[
  {
    "name": "Amman",
    "name_ar": "عمان",
    "lat": 31.9539,
    "lng": 35.9106,
    "district": "Capital",
    "country": "Jordan",
    "type": "city",
    "boundingbox": [31.81, 32.07, 35.72, 36.14]
  }
]
`, 'routing-api': `

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

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

ROUTE
/v1/routing/route
${isAr ? 'إحداثيات المسار' : 'Waypoints & Logic'}
start

"35.91,31.95" (lng,lat)

end

"35.85,31.82" (lng,lat)

profile car | bike | foot
alternatives Boolean
Traffic Analytics JSON
{
  "distance": 8420.5,
  "duration": 940,
  "traffic_duration": 1120,
  "geometry": "encoded_polyline_here",
  "steps": [
     { "instruction": "Turn right...", "distance": 200 }
  ]
}
` }; container.innerHTML = content[id] || '
Documentation section coming soon...
'; // Re-initialize icons if (window.lucide) lucide.createIcons(); } }; // Global initializer window.docs = docs;