### Install Pods and Open Workspace Source: https://yandex.com/maps-api/docs/mapkit/ios/generated/getting_started.html Install the dependencies defined in your Podfile and open the workspace to start development. ```bash pod install ``` ```bash open *.xcworkspace ``` -------------------------------- ### Get Basic Suggestion Source: https://yandex.com/maps-api/docs/suggest-api/examples.html This example shows how to get a basic suggestion for a given text query. ```HTTP https://suggest-maps.yandex.ru/v1/suggest?text=burj&apikey=YOUR_API_KEY ``` -------------------------------- ### Get suggest Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Basic example to get location suggestions for a given text query. ```APIDOC ## Get suggest ### Description Retrieves location suggestions based on the provided text query. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### With alternative routes Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates how to request multiple alternative routes. ```APIDOC ## GET /v2/route with alternative routes ### Description Builds a route and requests a specified number of alternative routes. ### Method GET ### Endpoint /v2/route ### Parameters #### Query Parameters - **waypoints** (string) - Required - The coordinates of the start and end points, separated by a pipe symbol (|). - **results** (integer) - Optional - The number of alternative routes to return. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&results=3&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Example results Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Demonstrates how to specify the number of objects to return in the response. ```text results=25 ``` -------------------------------- ### Get location by IP Source: https://yandex.com/maps-api/docs/locator-api/examples.html This example shows how to get location information using only the IP address. ```APIDOC ## Get location by IP ### Description Retrieves location information using only the IP address. ### Method POST ### Endpoint https://locator.api.maps.yandex.ru/v1/locate?apikey=YOUR_API_KEY ### Request Body ```json { "ip":[{"address":"2a02:6b0:c40:24a0:8000:40d1:940a:0"}] } ``` ``` -------------------------------- ### Get a list of countries, regions, cities in the response Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example to retrieve suggestions for countries, regions, and cities. ```APIDOC ## Get a list of countries, regions, cities in the response ### Description Retrieves suggestions for countries, regions, and cities. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **types** (string) - Optional - Set to 'country,province,locality' to get countries, regions, and cities. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&types=country,province,locality&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Example Map Request with Various Placemarks Source: https://yandex.com/maps-api/docs/static-api/request/markers.html An example URL demonstrating how to request a map image with multiple placemarks of different styles, colors, and sizes. ```http https://static-maps.yandex.ru/v1?lang=en_US&pt=28.98624,41.043451~28.95624,41.043451,78~28.94114,41.043451,pmgrs~28.98124,41.043451,pm2rdm~28.97624,41.043451,pmntl100~28.965573,41.04311,pmors23~28.950111,41.043451,flag~28.969573,41.04311,pm2ywl99~37.608,55.6,round&apikey=YOUR_API_KEY ``` -------------------------------- ### For public transport Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to build a route for public transport. ```APIDOC ## GET /v2/route for public transport ### Description Builds a route optimized for public transport. ### Method GET ### Endpoint /v2/route ### Parameters #### Query Parameters - **waypoints** (string) - Required - The coordinates of the start and end points, separated by a pipe symbol (|). - **mode** (string) - Optional - Set to `transit` for public transport routes. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=transit&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Example Type Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Shows how to specify the type of results to be returned. ```text type=biz ``` -------------------------------- ### Route Response Example (Walking) Source: https://yandex.com/maps-api/docs/router-api/response.html This example illustrates the response structure for a walking route query, highlighting differences in traffic type and the inclusion of specific attributes like 'levels' and 'constructions'. ```APIDOC ## GET /v2/route ### Description Retrieves route information between specified waypoints, optimized for walking, including detailed steps, duration, length, and polyline data. ### Method GET ### Endpoint /v2/route ### Parameters #### Query Parameters - **waypoints** (string) - Required - A pipe-separated list of latitude,longitude coordinates. - **mode** (string) - Optional - The mode of transport. Set to "walking" for walking routes. - **apikey** (string) - Required - Your Yandex Maps API key. ### Request Example ``` https://api.routing.yandex.net/v2/route?waypoints={{waypoints-walk}}&mode=walking&apikey=YOUR_API_KEY ``` ### Response #### Success Response (200) - **traffic_type** (string) - Indicates the type of traffic data used (e.g., "forecast"). - **route** (object) - Contains the route details. - **legs** (array) - An array of route legs. - **status** (string) - Status of the leg (e.g., "OK"). - **steps** (array) - An array of steps within the leg. - **length** (number) - Length of the step in meters. - **duration** (number) - Estimated duration of the step in seconds. - **mode** (string) - The mode of transport for the step (e.g., "walking"). - **waiting_duration** (number) - Estimated waiting time in seconds. - **polyline** (object) - Encodes the geometry of the step. - **points** (array) - An array of [latitude, longitude] pairs defining the polyline. - **levels** (object) - Information about elevation levels. - **level** (array) - Array of level objects, each with a 'count'. - **constructions** (object) - Information about road constructions. - **construction** (array) - Array of construction objects, each with 'count' and optional 'construction_mask'. #### Response Example ```json { "traffic_type": "forecast", "route": { "legs": [ { "status": "OK", "steps": [ { "length": 124, "duration": 89, "mode": "walking", "waiting_duration": 0, "polyline": { "points": [ [55.760097,37.617987], ... [55.75966,37.61825] ] }, "levels": { "level": [{"count": 10}] }, "constructions": { "construction": [ { "count": 1, "construction_mask": {"binding": true} }, ... ] } } ] } ] } } ``` ``` -------------------------------- ### Get an answer in the specified language Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example showing how to specify the desired language for the suggestions. ```APIDOC ## Get an answer in the specified language ### Description Retrieves location suggestions in a specific language. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **lang** (string) - Optional - The language code for the response (e.g., 'fr' for French). - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&lang=fr&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Get a Zero Tile on the First Zoom Source: https://yandex.com/maps-api/docs/tiles-api/examples.html This example retrieves a zero tile at the first zoom level (z=1). ```url https://tiles.api-maps.yandex.ru/v1/tiles/?x=0&y=0&z=1&lang=en_US&l=map&apikey=YOUR_API_KEY ``` -------------------------------- ### Get location by different signals Source: https://yandex.com/maps-api/docs/locator-api/examples.html This example demonstrates how to retrieve a location by providing a combination of Wi-Fi, cellular, and IP address information. ```APIDOC ## Get location by different signals ### Description Retrieves location information using a combination of Wi-Fi, cellular, and IP signals. ### Method POST ### Endpoint https://locator.api.maps.yandex.ru/v1/locate?apikey=YOUR_API_KEY ### Request Body ```json { "wifi": [ {"age": 100, "bssid": "744d28cd6a10", "signal_strength": -89}, {"age": 90, "bssid": "86d9e7c78b20", "signal_strength": -84}, {"age": 110, "bssid": "b869f47255d9", "signal_strength": -75} ], "cell": [ {"gsm": {"mcc": 250, "mnc": 99, "lac": 65534, "cid": 129430793, "signal_strength": -38}}, {"gsm": {"mcc": 260, "mnc": 75, "lac": 65500, "cid": 569430793, "signal_strength": -42}} ], "ip": [ {"address": "217.118.76.34"} ] } ``` ``` -------------------------------- ### Fetch Entire Map in a Single Tile Source: https://yandex.com/maps-api/docs/tiles-api/examples.html This example shows how to get the entire map in a single tile by setting zoom level (z) to 0. ```url https://tiles.api-maps.yandex.ru/v1/tiles/?x=0&y=0&z=0&lang=en_US&l=map&apikey=YOUR_API_KEY ``` -------------------------------- ### HTTP POST Request Example Source: https://yandex.com/maps-api/docs/locator-api/request.html This is an example of the HTTP POST request structure to the Locator API, including headers and a basic JSON body. ```http POST https://locator.api.maps.yandex.ru/v1/locate?apikey=YOUR_APIKEY Content-Type: application/json User-Agent: / { "wifi": ... , "cell": ... , "ip": ... } ``` -------------------------------- ### Request Body Example with WiFi, Cell, and IP Source: https://yandex.com/maps-api/docs/locator-api/request.html Example JSON structure for the request body, including detailed objects for WiFi, Cell (LTE and GSM), and IP address. ```json { "wifi": [ { "bssid": "2CD02D814C80", "signal_strength": -60, "channel" : 345, "age" : 100 } ], "cell": [ { "lte": { "mcc": 54157923, "mnc": 29, "tac": 27837, "ci": 40, "signal_strength": -60 } }, { "gsm": { "mcc": 14157933, "mnc": 99, "lac": 27864, "cid": 248, "signal_strength": -60 } } ], "ip": [ {"address": "95.108.173.231"} ] } ``` -------------------------------- ### Example Geosearch API Request URL Source: https://yandex.com/maps-api/docs/geosearch-api/response.html This is an example URL for searching businesses. Replace YOUR_API_KEY with your actual API key. ```url https://search-maps.yandex.ru/v1/?text=Dubai,The Museum of The Future&type=biz&lang=en_US&results=1&apikey=YOUR_API_KEY ``` -------------------------------- ### Polyline Coordinates Example Source: https://yandex.com/maps-api/docs/static-api/request/polylines.html Demonstrates the raw coordinate format for a polyline. ```text 37.593578 55.735094 37.592159 55.732469 37.589374 55.734162 ``` -------------------------------- ### Example Suggest API Request URL Source: https://yandex.com/maps-api/docs/suggest-api/response.html This is an example URL for making a request to the Yandex Maps Suggest API. Replace YOUR_API_KEY with your actual API key. ```url https://suggest-maps.yandex.ru/v1/suggest?apikey=YOUR_API_KEY&text=burj&print_address=1&attrs=uri ``` -------------------------------- ### Example Lang Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Illustrates the format for specifying the preferred response language and region. ```text lang=uk_UA ``` -------------------------------- ### WiFi Object Example Source: https://yandex.com/maps-api/docs/locator-api/request.html An example of a WiFi object within the request body, specifying BSSID, signal strength, channel, and age. ```json { "wifi": [ { "age": 94, "bssid": "44:27:f3:7e:59:02", "signal_strength": -79 }, { "age": 94, "bssid": "36:60:f9:27:3e:64", "signal_strength": -90 }, { "age": 94, "bssid": "c4:ad:34:5c:b6:b3", "signal_strength": -74 } ] } ``` -------------------------------- ### Coordinate Offsets Example Source: https://yandex.com/maps-api/docs/static-api/request/polylines.html Illustrates the calculation of offsets for subsequent points in a polyline. ```text 37593578 55735094 -1419 -2625 -2785 1693 ``` -------------------------------- ### Route Response Example (Driving) Source: https://yandex.com/maps-api/docs/router-api/response.html This example demonstrates the structure of a typical response for a driving route query, including traffic information, route legs, and detailed steps with polyline data. ```APIDOC ## GET /v2/route ### Description Retrieves route information between specified waypoints, including detailed steps, duration, length, and polyline data for driving. ### Method GET ### Endpoint /v2/route ### Parameters #### Query Parameters - **waypoints** (string) - Required - A pipe-separated list of latitude,longitude coordinates. - **apikey** (string) - Required - Your Yandex Maps API key. ### Request Example ``` https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&apikey=YOUR_API_KEY ``` ### Response #### Success Response (200) - **traffic_type** (string) - Indicates the type of traffic data used (e.g., "realtime"). - **route** (object) - Contains the route details. - **legs** (array) - An array of route legs. - **status** (string) - Status of the leg (e.g., "OK"). - **steps** (array) - An array of steps within the leg. - **duration** (number) - Estimated duration of the step in seconds. - **length** (number) - Length of the step in meters. - **polyline** (object) - Encodes the geometry of the step. - **points** (array) - An array of [latitude, longitude] pairs defining the polyline. - **mode** (string) - The mode of transport for the step (e.g., "driving"). - **waiting_duration** (number) - Estimated waiting time in seconds. - **flags** (object) - Flags indicating route characteristics. - **hasTolls** (boolean) - Indicates if the route has tolls. - **hasNonTransactionalTolls** (boolean) - Indicates if the route has non-transactional tolls. #### Response Example ```json { "traffic_type": "realtime", "route": { "legs": [ { "status": "OK", "steps": [ { "duration": 11.52513027, "length": 44.85900116, "polyline": { "points": [ [25.229762, 55.289311], ... [24.994437, 55.130251] ] }, "mode": "driving", "waiting_duration": 0 }, ... ] } ], "flags": { "hasTolls": true, "hasNonTransactionalTolls": false } } } ``` ``` -------------------------------- ### Thickness Example Source: https://yandex.com/maps-api/docs/static-api/request/polylines.html Sets the line thickness in pixels for polylines and polygon outlines. ```text w:8 ``` -------------------------------- ### Outline Thickness Example Source: https://yandex.com/maps-api/docs/static-api/request/polylines.html Sets the outline thickness in pixels for polygons. Defaults to 0 pixels. ```text bw:8 ``` -------------------------------- ### Example rspn Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Shows how to strictly restrict the search area to the defined boundaries. ```text rspn=1 ``` -------------------------------- ### Get a post-component address in the response Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example to get a post-component address in the suggestions. ```APIDOC ## Get a post-component address in the response ### Description Retrieves suggestions with a post-component address format. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **print_address** (integer) - Optional - Set to '1' to get a post-component address. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&print_address=1&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Build a Pedestrian Route Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates how to build a route for pedestrians by setting the 'mode' parameter to 'walking'. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=walking&apikey=YOUR_API_KEY ``` -------------------------------- ### Build a Public Transport Route Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates how to build a route for public transport by setting the 'mode' parameter to 'transit'. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=transit&apikey=YOUR_API_KEY ``` -------------------------------- ### Get only organizations in response Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example to filter suggestions to include only organizations. ```APIDOC ## Get only organizations in response ### Description Filters the suggestions to return only organizations. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **types** (string) - Optional - Set to 'biz' to get only organizations. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&types=biz&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Get field uri in the response Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example to retrieve the 'uri' field in the suggestions. ```APIDOC ## Get field uri in the response ### Description Retrieves suggestions including the 'uri' field. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **attrs** (string) - Optional - Set to 'uri' to include the 'uri' field. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&attrs=uri&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Build a Route with Departure Time Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to build a route considering a specific departure time, useful for traffic forecast integration. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&departure_time=YOUR_UNIX_TIME&apikey=YOUR_API_KEY ``` -------------------------------- ### Example Tiles API Request Source: https://yandex.com/maps-api/docs/tiles-api/quickstart.html This is an example of a GET request to the Yandex Maps Tiles API to retrieve map tiles. Replace YOUR_API_KEY with your actual API key. ```HTTP https://tiles.api-maps.yandex.ru/v1/tiles/?x=38048&y=24596&z=16&lang=en_US&l=map&apikey=YOUR_API_KEY ``` -------------------------------- ### Build a Truck Route Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates how to build a route for a truck by setting the 'mode' parameter to 'truck'. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=truck&apikey=YOUR_API_KEY ``` -------------------------------- ### Example ll and spn Parameters Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Demonstrates how to define the search area using center coordinates (ll) and its size (spn). ```text ll=55.276394,25.195679&spn=0.552069,0.400552 ``` -------------------------------- ### Get only organizations and metro stations in response Source: https://yandex.com/maps-api/docs/suggest-api/examples.html Example to filter suggestions to include organizations and metro stations. ```APIDOC ## Get only organizations and metro stations in response ### Description Filters the suggestions to return only organizations and metro stations. ### Method GET ### Endpoint https://suggest-maps.yandex.ru/v1/suggest ### Parameters #### Query Parameters - **text** (string) - Required - The text to search for suggestions. - **types** (string) - Optional - Set to 'biz,metro' to get organizations and metro stations. - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://suggest-maps.yandex.ru/v1/suggest?text=burj&types=biz,metro&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Basic Tile Request with Required Parameters Source: https://yandex.com/maps-api/docs/tiles-api/examples.html This example shows a basic tile request using only the essential parameters like coordinates (x, y, z), language, layer, and API key. ```url https://tiles.api-maps.yandex.ru/v1/tiles/?x=38048&y=24596&z=16&lang=en_US&l=map&apikey=YOUR_API_KEY ``` -------------------------------- ### Get Location by Mobile Network Signals (WCDMA, LTE) Source: https://yandex.com/maps-api/docs/locator-api/examples.html Use this example to get location based on WCDMA and LTE cellular network signals. Ensure correct MCC, MNC, LAC/TAC, and CID/CI values are provided. ```curl curl -H "Content-Type: application/json" \ -X POST "https://locator.api.maps.yandex.ru/v1/locate?apikey=YOUR_API_KEY" \ -d '{ "cell": [ { "wcdma": { "age": 452, "uarfcn": 2850, "cid": 248700418, "mcc": 250, "lac": 7702, "mnc": 2, "psc": 261, "signal_strength": -84 } }, { "lte": { "age": 4824, "mcc": 250, "mnc": 20, "tac": 27842, "ci": 197504789, "pci": 103, "signal_strength": -120 } } ] }' ``` -------------------------------- ### Example bbox Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Illustrates an alternative method for setting the search area using bounding box coordinates. ```text bbox=25.20, 55.26~25.18, 55.28 ``` -------------------------------- ### Get location by mobile network signals Source: https://yandex.com/maps-api/docs/locator-api/examples.html This example demonstrates how to retrieve location information using mobile network signals (WCDMA and LTE). ```APIDOC ## Get location by mobile network signals ### Description Retrieves location information using mobile network signals (WCDMA and LTE). ### Method POST ### Endpoint https://locator.api.maps.yandex.ru/v1/locate?apikey=YOUR_API_KEY ### Request Body ```json { "cell": [ { "wcdma": { "age": 452, "uarfcn": 2850, "cid": 248700418, "mcc": 250, "lac": 7702, "mnc": 2, "psc": 261, "signal_strength": -84 } }, { "lte": { "age": 4824, "mcc": 250, "mnc": 20, "tac": 27842, "ci": 197504789, "pci": 103, "signal_strength": -120 } } ] } ``` ``` -------------------------------- ### Create Podfile for MapKit Source: https://yandex.com/maps-api/docs/mapkit/ios/generated/getting_started.html Create a Podfile to manage dependencies. Add the MapKit library to your target. ```bash pod init ``` ```bash use_frameworks! # The lite library only contains the map, traffic layer, # LocationManager, and UserLocationLayer # and lets you download offline maps (in the paid version only). pod 'YandexMapsMobile', '4.36.0-lite' # The full library supplements lite version features with car routing, # bike routing, pedestrian routing, and public transport routing, # search, suggest, geocoding, and panorama display. # pod 'YandexMapsMobile', '4.36.0-full' ``` -------------------------------- ### Restrict number of results (skip and limit) Source: https://yandex.com/maps-api/docs/geosearch-api/examples.html Use 'results' and 'skip' parameters to paginate through results. This example requests one result, starting from the third. ```HTTP https://search-maps.yandex.ru/v1/?text=Etihad Museum&results=1&skip=2&lang=en_US&apikey=YOUR_API_KEY ``` -------------------------------- ### Example skip Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Illustrates how to skip a certain number of objects in the response, used with the 'results' parameter. ```text skip=25 ``` -------------------------------- ### Build a Route with Alternative Routes Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to request multiple alternative routes by setting the 'results' parameter to 3. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&results=3&apikey=YOUR_API_KEY ``` -------------------------------- ### Generic Base64 Encoded String Example Source: https://yandex.com/maps-api/docs/static-api/request/polylines.html An example of a fully Base64-encoded string representing polyline coordinates. ```text 6qE9AjZzUgN1-v__v_X__x_1__-dBgAA ``` -------------------------------- ### API Error Message Example Source: https://yandex.com/maps-api/docs/router-api/response.html An example of an API error message structure, indicating a missing 'waypoints' parameter. ```json { "errors": ["0: 0: parameter 'waypoints' is missing"] } ``` -------------------------------- ### Example Text Parameter Usage Source: https://yandex.com/maps-api/docs/geosearch-api/request.html Demonstrates various ways to use the 'text' parameter for different types of search queries. ```text text=The Burj Khalifa ``` ```text text=25.197091, 55.274259 ``` ```text text=Dubai, 1, Mohammed Bin Rashid Boulevard ``` ```text text=+971 4 8888888 ``` ```text text=Dubai Mall ``` -------------------------------- ### Floor-aware route (only the end point has a floor) Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates how to build a floor-aware walking route, useful for multi-level buildings. ```APIDOC ## GET /v2/route with floor information ### Description Builds a walking route that considers floor information for the end point. ### Method GET ### Endpoint /v2/route ### Parameters #### Query Parameters - **waypoints** (string) - Required - The coordinates of the start and end points, separated by a pipe symbol (|). - **mode** (string) - Optional - Set to `walking` for pedestrian routes. - **levels** (string) - Optional - Specifies the floor level for the end point (e.g., `,4`). - **apikey** (string) - Required - Your Yandex API key. ### Request Example ``` https://api.routing.yandex.net/v2/route?waypoints=55.759461,37.618963|55.760618,37.619867&mode=walking&levels=,4&apikey=YOUR_API_KEY ``` ``` -------------------------------- ### Build a Route Avoiding Unpaved and Poor Condition Roads Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to build a route that avoids both unpaved roads and roads in poor condition by setting respective parameters to true. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&avoid_unpaved=true&avoid_poor_condition=true&apikey=YOUR_API_KEY ``` -------------------------------- ### Get Async Matrix Results Source: https://yandex.com/maps-api/docs/distancematrix-api/async/quickstart.html Send a GET request to retrieve the generated distance matrix once the asynchronous operation has completed. The response is gzip-encoded. ```APIDOC ## GET /v2/distancematrix_async/driving/matrices/get ### Description Retrieves the resulting distance matrix after an asynchronous operation has finished. The response is gzip-encoded. ### Method GET ### Endpoint https://api.routing.yandex.net/v2/distancematrix_async/driving/matrices/get ### Query Parameters - **apikey** (string) - Required - Your API key. - **id** (string) - Required - The ID of the matrix to retrieve. ### Response #### Success Response (200) - The response body contains the gzip-encoded distance matrix data. ``` -------------------------------- ### Get Async Operation Status Source: https://yandex.com/maps-api/docs/distancematrix-api/async/quickstart.html Send a GET request to retrieve the status of an asynchronous matrix generation operation using its unique ID. ```APIDOC ## GET /v2/distancematrix_async/driving/operations/get ### Description Retrieves the status of an ongoing asynchronous distance matrix operation. ### Method GET ### Endpoint https://api.routing.yandex.net/v2/distancematrix_async/driving/operations/get ### Query Parameters - **apikey** (string) - Required - Your API key. - **id** (string) - Required - The ID of the operation to check. ``` -------------------------------- ### Static API Usage Source: https://yandex.com/maps-api/docs/static-api/index.html This snippet shows the base URL format and an example of how to construct a request to the Static API, including common parameters like location, language, size, zoom, markers, and an API key. ```APIDOC ## Static API The Static API generates a map image based on the parameter values passed to the service in a URL with the following format: ``` https://static-maps.yandex.ru/v1?{URL parameters} ``` The `{URL parameters}` string contains a sequence of pairs in the format `{parameter name}={parameter value}` separated by the ampersand symbol (`&`). ### Example Request This example requests a map image of the center of Moscow with two numbered markers: ``` https://static-maps.yandex.ru/v1?ll=37.620070,55.753630&lang=en_US&size=450,450&z=13&pt=37.620070,55.753630,pmwtm1~37.64,55.76363,pmwtm99&apikey=YOUR_API_KEY ``` ### URL Parameters - **ll** (string) - Required - Specifies the center of the map. Format: `longitude,latitude`. - **lang** (string) - Optional - Specifies the language of the map tiles and labels. Example: `en_US`. - **size** (string) - Optional - Specifies the size of the map image in pixels. Format: `width,height`. - **z** (integer) - Optional - Specifies the zoom level of the map. Example: `13`. - **pt** (string) - Optional - Specifies markers to be displayed on the map. Format: `longitude,latitude,style~longitude,latitude,style`. - **apikey** (string) - Required - Your Yandex API key. ``` -------------------------------- ### Example Suggest API JSON Response Source: https://yandex.com/maps-api/docs/suggest-api/response.html This is an example of the JSON response structure returned by the Yandex Maps Suggest API for a successful query. ```json { "results": [ { "title": { "text": "Burj Khalifa, Zaabeel, Dubai", "hl": [ { "begin": 0, "end": 10 }, { "begin": 18, "end": 20 } ] }, "subtitle": { "text": "Dubai" }, "tags": [ "house" ], "distance": { "text": "7141.91 km", "value": 7141908.95 }, "address": { "formatted_address": "Burj Khalifa, Zaabeel, Dubai", "component": [ { "name": "United Arab Emirates", "kind": [ "COUNTRY" ] }, { "name": "Emirate Dubai", "kind": [ "PROVINCE" ] }, { "name": "Dubai", "kind": [ "PROVINCE" ] }, { "name": "Dubai", "kind": [ "LOCALITY" ] }, { "name": "Zaabeel", "kind": [ "STREET" ] }, { "name": "1", "kind": [ "HOUSE" ] } ] }, "uri": "ymapsbm1://geo?data=Cgg1MzA2MzU1OBIy0JzQvtGB0LrQvtCy0YHQutCw0Y8g0L7QsdC70LDRgdGC0YwsINCc0YvRgtC40YnQuCA," } ] } ``` -------------------------------- ### Build a Truck Route with Weight and Length Parameters Source: https://yandex.com/maps-api/docs/router-api/examples.html This example demonstrates building a truck route specifying the truck's weight (5 tons) and length (12 meters). ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=truck&weight=5&length=12&apikey=YOUR_API_KEY ``` -------------------------------- ### Yandex Maps Tiles API Request Example Source: https://yandex.com/maps-api/docs/tiles-api/response.html An example of a successful request to the Yandex Maps Tiles API for retrieving map tiles. ```APIDOC ## GET https://tiles.api-maps.yandex.ru/v1/tiles/ ### Description Retrieves map tiles based on specified parameters. ### Method GET ### Endpoint https://tiles.api-maps.yandex.ru/v1/tiles/ ### Parameters #### Query Parameters - **scale** (integer) - Optional - Specifies the scale of the tile (e.g., 2 for high resolution). - **x** (integer) - Required - The x-coordinate of the tile. - **y** (integer) - Required - The y-coordinate of the tile. - **z** (integer) - Required - The zoom level. - **lang** (string) - Optional - The language for map labels (e.g., en_US). - **l** (string) - Optional - The layer to retrieve (e.g., map). - **apikey** (string) - Required - Your Yandex API key. ### Response #### Success Response (200) - The response will be a tile image in a format determined by the API (e.g., PNG, JPEG). #### Response Example (Binary tile data) ``` -------------------------------- ### Build a Truck Route with Vehicle Permits Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to build a truck route that includes vehicle permits for entering restricted zones, such as 'msk_mkad' and 'msk_ttk'. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=25.234369457896325,55.280222457968712|25.234369457896325,55.401544758961258&mode=truck&vehicle_permits=msk_mkad,msk_ttk&apikey=YOUR_API_KEY ``` -------------------------------- ### Example Walking Route Request URL Source: https://yandex.com/maps-api/docs/router-api/response.html This URL demonstrates how to request a walking route. Ensure to replace {{waypoints-walk}} with actual waypoint coordinates and YOUR_API_KEY with your API key. ```url https://api.routing.yandex.net/v2/route?waypoints={{waypoints-walk}}&mode=walking&apikey=YOUR_API_KEY ``` -------------------------------- ### Example 400 Bad Request: Empty Text Parameter Source: https://yandex.com/maps-api/docs/geosearch-api/response.html This example shows a 400 Bad Request error when the 'text' parameter is empty. ```json {"statusCode": 400, "error": "Bad Request", "message": "Parameter \"text\": \"text\" is not allowed to be empty"} ``` -------------------------------- ### Create and Link a DOM Entity Source: https://yandex.com/maps-api/docs/js-api/entity-system/index.md This example demonstrates creating a custom entity that links to the DOM using `useDomContext`. It shows how to create the entity's DOM element and a container for child entities, and how to initialize and add these entities to the map. ```typescript class YMapDOMEntity extends ymaps3.YMapGroupEntity<{text: string}> { private _element?: HTMLHeadingElement; private _container?: HTMLDivElement; private _detachDom?: () => void; protected _onAttach(): void { // Create a DOM element that will be linked to the entity. this._element = document.createElement('div'); this._element.textContent = this._props.text; this._element.classList.add('element'); // Create a container for the DOM elements of child entities. this._container = document.createElement('div'); this._container.classList.add('container'); // Insert the container inside the element. this._element.appendChild(this._container); // Create entity linking to the DOM. this._detachDom = ymaps3.useDomContext(this, this._element, this._container); } protected _onDetach(): void { // Detach the DOM from the entity and remove references to the elements. this._detachDom?.(); this._detachDom = undefined; this._element = undefined; this._container = undefined; } } // Initializing the root element. map = new ymaps3.YMap(document.getElementById('app'), {location: LOCATION}); // Initialize the YMapDOMEntity class entities. const DOMEntity = new YMapDOMEntity({text: 'DOM Entity'}); const childDOMEntity = new YMapDOMEntity({text: 'Child DOM Entity'}); // DOMEntity._element will be inserted into the map's DOM element. map.addChild(DOMEntity); // childDOMEntity._element will be added to DOMEntity._container. DOMEntity.addChild(childDOMEntity); ``` -------------------------------- ### Distance Matrix API Request Example Source: https://yandex.com/maps-api/docs/distancematrix-api/response.html An example of a Distance Matrix API request URL with origins, destinations, mode, and API key. ```URL https://api.routing.yandex.net/v2/distancematrix?origins=25.249269,55.350952|25.248066,55.351206&destinations=25.225335,55.254270&mode=transit&apikey=YOUR_API_KEY ``` -------------------------------- ### Build a Floor-Aware Pedestrian Route Source: https://yandex.com/maps-api/docs/router-api/examples.html This example shows how to build a pedestrian route where only the end point has a specified floor. The 'levels' parameter is used for this. ```HTTP https://api.routing.yandex.net/v2/route?waypoints=55.759461,37.618963|55.760618,37.619867&mode=walking&levels=,4&apikey=YOUR_API_KEY ```