Koleksiyonlar ile düzeninizi koruyun
İçeriği tercihlerinize göre kaydedin ve kategorilere ayırın.
Rota boyunca arayın
Bir rota boyunca arama yapmak için Text Search (New)'ü kullanmak üzere Routes API'den önceden hesaplanmış rotayı istekte çoklu çizgi olarak iletin. Yanıtta, arama ölçütleriyle eşleşen ve belirtilen rotanın yakınında bulunan yerler yer alır.
Arama sonuçlarını rotaya göre yönlendirmek için rotanın kodlanmış çoklu çizgisini Text Search (New) hizmetine iletmek üzere searchAlongRouteParameters.polyline.encodedPolyline parametresini kullanın. Yanıt, arama ölçütleriyle eşleşen ve belirtilen rotanın yakınında bulunan yerleri içerir.
API Gezgini, API ve API seçenekleri hakkında bilgi edinmek için canlı isteklerde bulunmanıza olanak tanır:
Varsayılan olarak, Metin Arama (Yeni), çoklu çizgiyle tanımlanan başlangıç noktasından hedef noktaya kadar olan tüm rota boyunca arama yapar. Aşağıdaki örnekte, çoklu çizgi şu rotayı tanımlar:
Kaynak: 1600 Amphitheatre Parkway, Mountain View, CA
Hedef: 24 Willie Mays Plaza, San Francisco, CA
Bu rota için gezinin kodlanmış çoklu çizgisi şu dizeyle gösterilir:
Sonuçları tüm rotaya göre yönlendirmeniz gerekmez. Örneğin, aramayı yapmadan önce rotanın yarısına gelmiş olabilirsiniz. Bu durumda, kodlanmış çoklu çizgi içinde tanımlanan kaynağı geçersiz kılmak için aramaya yönelik açık bir yönlendirme kaynağı belirtebilirsiniz. Aşağıdaki örnekte, rota çoklu çizgisinin yaklaşık yarısında bulunan San Mateo, CA'nın enlem ve boylam koordinatlarını belirtiyorsunuz:
[[["Anlaması kolay","easyToUnderstand","thumb-up"],["Sorunumu çözdü","solvedMyProblem","thumb-up"],["Diğer","otherUp","thumb-up"]],[["İhtiyacım olan bilgiler yok","missingTheInformationINeed","thumb-down"],["Çok karmaşık / çok fazla adım var","tooComplicatedTooManySteps","thumb-down"],["Güncel değil","outOfDate","thumb-down"],["Çeviri sorunu","translationIssue","thumb-down"],["Örnek veya kod sorunu","samplesCodeIssue","thumb-down"],["Diğer","otherDown","thumb-down"]],["Son güncelleme tarihi: 2025-09-04 UTC."],[[["\u003cp\u003eText Search can be used to find places along a route calculated by the Routes API by providing the route's encoded polyline.\u003c/p\u003e\n"],["\u003cp\u003eThe search results are biased towards the provided route, returning places that match the search criteria and are near the route.\u003c/p\u003e\n"],["\u003cp\u003eYou can specify a starting point along the route to refine the search, such as searching for places from a specific location along the route to the destination.\u003c/p\u003e\n"],["\u003cp\u003eSearch along route returns places with minimal detour times from origin to destination, so if the origin and destination are the same or close, it may not return any results.\u003c/p\u003e\n"]]],["To search along a route, use the Routes API to calculate a route and obtain its encoded polyline. Then, use the `searchAlongRouteParameters.polyline.encodedPolyline` parameter in the Text Search (New) request to specify this polyline. This biases the search results to places near the route. Optionally, you can define a `routingParameters.origin` to search from a specific point along the route instead of the polyline's origin. You can then experiment using APIs Explorer.\n"],null,["Search along route\n==================\n\nTo use [Text Search (New)](/maps/documentation/places/web-service/text-search) to search along a route, pass the precalculated route\nfrom the [Routes API](/maps/documentation/routes/compute_route_directions) in\nthe request as a polyline. The response contains places that match the search\ncriteria and are also located near the specified route.\n\nTo search along a route:\n\n1. Use the Routes API to calculate a route that [returns a route's encoded\n polyline](/maps/documentation/routes/traffic_on_polylines) in the response.\n\n | **Note:** You can also encode your own polyline as described in [Encoded\n | Polyline Algorithm Format](/maps/documentation/utilities/polylinealgorithm).\n2. Use the `searchAlongRouteParameters.polyline.encodedPolyline` parameter to\n pass the route's encoded polyline to Text Search (New) to bias the search\n results to the route. The response then contains places that match the\n search criteria and are also located near the specified route.\n\nThe APIs Explorer lets you make live requests so that you can get familiar with\nthe API and the API options: \n[Try it!](#try_it)\n\nBy default, Text Search (New) performs the search along the entire route from\nthe origin to the destination as defined by the polyline. In the following\nexample, the polyline defines the route from:\n\n- **Origin**: 1600 Amphitheatre Parkway, Mountain View, CA\n- **Destination**: 24 Willie Mays Plaza, San Francisco, CA\n\nThe trip's encoded polyline for this route is represented by the string: \n\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@PeCVcIf@gAAkAQy@YiAo@_A{@_DgEgJqM_DeEaM}PoBiCzAsBw@kAdAGVk@f@q@z@C\n```\n| **Note:** Search along route only supports an encoded polyline, which can be passed as a string and includes compression with minimal lossiness. This is the Routes API default output. For more information, see [Request route\n| polylines](/maps/documentation/routes/traffic_on_polylines).\n\nThe following example uses the route's encoded polyline to bias the search\nresults: \n\n```scdoc\n curl -X POST -d '{\n \"textQuery\" : \"Spicy Vegetarian Food\",\n \"searchAlongRouteParameters\": {\n \"polyline\": {\n \"encodedPolyline\": \"\u003cvar translate=\"no\"\u003eROUTE_POLYLINE\u003c/var\u003e\"\n }\n }\n }' \\\n -H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n -H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel' \\\n 'https://places.googleapis.com/v1/places:searchText'\n```\n\nThe response contains the places that match the search criteria, biased to the\nroute: \n\n```yaml\n {\n \"places\": [\n {\n \"formattedAddress\": \"60 Morris St, San Francisco, CA 94107, USA\",\n \"priceLevel\": \"PRICE_LEVEL_MODERATE\",\n \"displayName\": {\n \"text\": \"Umami Express\",\n \"languageCode\": \"en\"\n }\n },\n {\n \"formattedAddress\": \"1130 4th St, San Francisco, CA 94158, USA\",\n \"priceLevel\": \"PRICE_LEVEL_MODERATE\",\n \"displayName\": {\n \"text\": \"House of Tadu Ethiopian Kitchen\",\n \"languageCode\": \"en\"\n }\n },\n {\n \"formattedAddress\": \"1602 El Camino Real Ste A, Belmont, CA 94002, USA\",\n \"priceLevel\": \"PRICE_LEVEL_MODERATE\",\n \"displayName\": {\n \"text\": \"Eats Meets West Bowls\",\n \"languageCode\": \"en\"\n }\n },\n /.../\n ]\n }\n```\n\nYou don't have to bias the results to the entire route. For example, you might\nalready be halfway along the route before you perform the search. In this case,\nyou can specify an explicit routing origin to the search to override the origin\ndefined in the encoded polyline. In the following example, you specify the\nlatitude and longitude coordinates of San Mateo, CA, which is approximately\nhalfway along the route polyline: \n\n```scdoc\n curl -X POST -d '{\n \"textQuery\" : \"Spicy Vegetarian Food\",\n \"searchAlongRouteParameters\": {\n \"polyline\": {\n \"encodedPolyline\": \"\u003cvar translate=\"no\"\u003eROUTE_POLYLINE\u003c/var\u003e\"\n }\n },\n \"routingParameters\": {\n \"origin\": {\n \"latitude\": 37.56617,\n \"longitude\": -122.30870\n }\n }\n }' \\\n -H 'Content-Type: application/json' -H 'X-Goog-Api-Key: API_KEY' \\\n -H 'X-Goog-FieldMask: places.displayName,places.formattedAddress,places.priceLevel' \\\n 'https://places.googleapis.com/v1/places:searchText'\n```\n| **Note:** Because search along route returns places with minimal detour times from origin to destination, in cases where the route origin and destination are the same or close to one another, search along route may not return any results.\n\nTry it!\n-------\n\nThe APIs Explorer lets you make sample requests so\nthat you can get familiar with the API and the API options.\n\n1. Select the API icon api\n on the right side of the page.\n\n2. Optionally edit the request parameters.\n\n3. Select the **Execute** button. In the dialog, choose the account\n that you want to use to make the request.\n\n4. In the APIs Explorer panel, select the fullscreen icon\n fullscreen to expand the APIs Explorer window."]]