Embedding Ali Mapsتضمين خرائط علي

Ali Maps is a road map of Riyadh traced from satellite imagery, which works out routes in the visitor's browser. It goes on your page as an iframe, and there are two ways to write it.خرائط علي خريطة طرق للرياض مرسومة من صور الأقمار الصناعية، تحسب المسارات في متصفّح الزائر. وتوضع في صفحتك داخل iframe، ولكتابتها طريقتان.

The second way has the same URL shape as Google's embed. If you have embedded a Google map before, change the host and the path and keep everything else.والطريقة الثانية لها شكل عنوان تضمين Google نفسه. فإن سبق لك أن ضمّنت خريطة Google، فغيّر المضيف والمسار وأبقِ ما سواهما.

In development — not open for sign-up yet. Embedding needs no account and no key.قيد التطوير — لم يُفتح للتسجيل بعد. والتضمين لا يحتاج حساباً ولا مفتاحاً.

The short wayالطريقة المختصرة

An iframe on the map itselfiframe على الخريطة نفسها

<iframe src="https://maps.ali-web-services.com/?f=osm&from=24.7136,46.6753&to=24.8894,46.6293"
        width="100%" height="420" style="border:0" loading="lazy"></iframe>
The snippet above, live: this is the map itself, running in a frame on this page.هذا هو المقتطف أعلاه يعمل فعلياً: الخريطة نفسها داخل إطار في هذه الصفحة.

A map loaded inside an iframe hides its own controls automatically, so a bare src is enough. embed=1 does the same for a page that is not in a frame.الخريطة المحمّلة داخل iframe تُخفي أدوات التحكّم الخاصة بها تلقائياً، فيكفي src وحده. ويفعل embed=1 الشيء نفسه لصفحة ليست داخل إطار.

ParameterالمُعامِلMeaningالمعنى
fcorpus (the default) or osm — see Two maps belowcorpus (الافتراضي) أو osm — انظر خريطتان أدناه
embed1 hides the controls1 يُخفي أدوات التحكّم
lat, lon, zOpen on a place. z is the width of the view in metres, not a zoom levelيفتح على مكان. وz هو عرض المشهد بالأمتار، لا مستوى تكبير
from, tolat,lon each. Works out the route on load and fits the view to itlat,lon لكلٍّ منهما. يحسب المسار عند التحميل ويضبط المشهد عليه
kHow many different roads to try when attaching a point to the network. Default 1عدد الطرق المختلفة التي تُجرَّب عند ربط نقطة بالشبكة. الافتراضي 1
areaWhich district, when a map has more than oneأيّ حيّ، حين تضمّ الخريطة أكثر من حيّ
vA specific tile-set release. Without it you get the newestإصدار محدّد من مجموعة البلاطات. ومن دونه تحصل على الأحدث
The snippet builder on the map itself builds this iframe and runs it on the same page, so what you see working there is exactly what you copy.منشئ المقتطف على الخريطة نفسها يبني هذا الـiframe ويشغّله في الصفحة نفسها، فما تراه يعمل هناك هو بعينه ما تنسخه.
The Google-shaped wayالطريقة على شكل Google

The /embed/v1 endpointsنقاط /embed/v1

Five modes, the same five Google has, with Google's parameter names wherever we have the thing they name. Each mode works with or without .html on the end, so the same URL works behind any static host.خمسة أوضاع، هي أوضاع Google الخمسة نفسها، بأسماء مُعامِلات Google حيثما كان لدينا ما تسمّيه. ويعمل كل وضع بـ.html في آخره أو من دونها، فيعمل العنوان نفسه خلف أيّ مضيف ثابت.

EndpointالنقطةParametersالمُعامِلات
/embed/v1/viewcenter, zoom, maptype
/embed/v1/placeq, center, zoom, maptype
/embed/v1/directionsorigin, destination, mode, avoid
/embed/v1/searchq, center, zoom
/embed/v1/streetviewlocation, heading, pitch, fov
<iframe src="https://maps.ali-web-services.com/embed/v1/directions?origin=24.7136,46.6753&destination=24.8894,46.6293"
        width="100%" height="420" style="border:0" loading="lazy"></iframe>
The same journey, opened with /embed/v1/directions.الرحلة نفسها، مفتوحةً عبر /embed/v1/directions.

Where we differ from Googleحيث نختلف عن Google

Where we cannot do what a parameter asks, the map says so on screen. It does not quietly show something else.حيث لا نستطيع ما يطلبه مُعامِل، تقول الخريطة ذلك على الشاشة. ولا تعرض شيئاً آخر بصمت.

  • key is accepted and ignored. There is no quota to count and no account to bill, so there is nothing for a key to unlock. A Google snippet you paste in keeps working with its key left in.key مقبول ومُتجاهَل. لا حصّة تُعدّ ولا حساب يُفوتَر، فلا شيء يفتحه المفتاح. والمقتطف الذي تلصقه من Google يظلّ يعمل ومفتاحه فيه.
  • maptype=satellite and hybrid show the road map and say so. There is no satellite layer to switch to.maptype=satellite وhybrid تعرضان خريطة الطرق وتقولان ذلك. فلا طبقة أقمار صناعية يُنتقل إليها.
  • Directions are for driving only. Any other mode shows a driving route and says so. avoid is not supported — the road model has no tolls, ferries or motorways to avoid — and the map says that too.الاتجاهات للقيادة فقط. وأيّ mode آخر يعرض مسار قيادة ويقول ذلك. وavoid غير مدعوم — فنموذج الطرق لا رسوم فيه ولا عبّارات ولا طرق سريعة تُتجنَّب — والخريطة تقول ذلك أيضاً.
  • q, origin and destination always take lat,lon. A street name works on the osm map only. The road network we trace ourselves has no street names.q وorigin وdestination تقبل lat,lon دائماً. واسم الشارع يعمل على خريطة osm وحدها. فشبكة الطرق التي نرسمها بأنفسنا بلا أسماء شوارع.
  • Street view is not photography. It is our road map seen from the driver's seat at the given point.عرض الشارع ليس تصويراً. بل هو خريطة طرقنا كما تُرى من مقعد السائق عند النقطة المعطاة.
  • zoom is a zoom level, the same as Google's.zoom مستوى تكبير، كما هو عند Google.
Two mapsخريطتان

Two maps, and the difference mattersخريطتان، والفرق بينهما مهمّ

  • f=corpus is the product: road network traced from satellite imagery, with no road network imported from anywhere else at any stage.f=corpus هي المنتج: شبكة طرق مرسومة من صور الأقمار الصناعية، دون استيراد أيّ شبكة طرق من مصدر آخر في أيّ مرحلة.
  • f=osm is OpenStreetMap redrawn in our model — a demonstration that runs the whole application across a city. It carries a badge saying so, which an embed cannot hide, and an attribution to OpenStreetMap's contributors. Do not style that attribution away.f=osm هي OpenStreetMap مُعاد رسمها في نموذجنا — عرض توضيحي يشغّل التطبيق كله على مستوى مدينة. وتحمل شارة تقول ذلك لا يستطيع التضمين إخفاءها، وإسناداً لمساهمي OpenStreetMap. لا تُخفِ هذا الإسناد بالتنسيق.

The corpus map carries no badge. A map built from somebody else's data has to say so; ours does not need to say it is ours.خريطة corpus لا تحمل شارة. فالخريطة المبنية على بيانات غيرنا يجب أن تقول ذلك؛ أما خريطتنا فلا حاجة لأن تقول إنها لنا.

Before you embedقبل التضمين

Worth knowing up frontما يحسن معرفته مسبقاً

  • No key, no server, nothing to set up. The map is tiles fetched straight from object storage by the visitor's browser, and routes are worked out on the visitor's device. There is nothing for us to rate-limit.لا مفتاح ولا خادم ولا شيء يُجهَّز. الخريطة بلاطات يجلبها متصفّح الزائر مباشرة من تخزين الكائنات، والمسارات تُحسب على جهاز الزائر. فلا شيء لدينا نحدّ معدّله.
  • It covers Riyadh. Outside the published area the map is empty by design, and the page shows a button that takes the visitor back.تغطّي الرياض. وخارج المنطقة المنشورة تكون الخريطة فارغة بطبيعة بنائها، وتعرض الصفحة زرّاً يُعيد الزائر إليها.
  • Sizing. The map fills its iframe and works on a phone. Keep loading="lazy": the first view has to fetch its tiles.المقاس. تملأ الخريطة الـiframe الخاص بها وتعمل على الهاتف. وأبقِ loading="lazy": فالمشهد الأول يجلب بلاطاته.
  • Pin a release with v= if the embed must not change under you. Without it, an embed always shows the newest tile set.ثبّت إصداراً بـv= إن كان التضمين يجب ألّا يتغيّر من تحتك. ومن دونه يعرض التضمين دائماً أحدث مجموعة بلاطات.