Перейти к содержимому

Google maps url как узнать

  • автор:

Google maps url как узнать

WordPress 6 с Нуля до Гуру

WordPress 6 с Нуля до Гуру

Этот курс научит Вас созданию самых разных сайтов на самой популярной в мире CMS — WordPress. Вы увидите установку и настройку локального сервера, разбор каждой настройки, каждой кнопки и каждого пункта меню в панели WordPress.

Также Вы получите и всю практику, поскольку прямо в курсе с нуля создаётся полноценный Интернет-магазин, который затем публикуется в Интернете. И всё это прямо на Ваших глазах.

Помимо уроков к курсу идут упражнения для закрепления материала.

И, наконец, к курсу идёт ценнейший Бонус по тому, как используя ChatGPT и создавая контент для сайта, можно выйти на пассивный доход. Вы наглядно увидите, как зарегистрироваться в ChatGPT (в том числе, и если Вы из России), как правильно выбрать тему для сайта, как правильно генерировать статьи для него(чтобы они индексировались поисковыми системами) и как правильно монетизировать трафик на сайте.

Подпишитесь на мой канал на YouTube, где я регулярно публикую новые видео.

Подписаться

Подписавшись по E-mail, Вы будете получать уведомления о новых статьях.

Подписаться

Добавляйтесь ко мне в друзья ВКонтакте! Отзывы о сайте и обо мне оставляйте в моей группе.

Какие параметры следует использовать в URL-адресе Google Maps для перехода на lat-lon?

Я хотел бы создать url-адрес для карт Google, который идет на определенную широту и долготу. Теперь я создаю url-адрес, такой как:

полученная карта имеет круглый указатель «A», который, кажется, указывает на ближайший именованный объект, и зеленую стрелку, которая указывает на lat-lon. Иногда, как в этом примере, указатель «A» центрирован и находится достаточно далеко что вы не видите указатель на lat-lon. (Уменьшите масштаб, чтобы увидеть оба указателя в этом примере. Указатель » а » находится в центре Аляски, а указатель длиной в лат-на острове Кадьяк.)

есть ли некоторые параметры, которые я могу использовать в URL Google Maps, которые будут создавать один указатель на назначенный lat-lon? (Это загружается в отдельном окне. Он не встроен.)

15 ответов

в мае 2017 года Google объявил Google Maps URLs API, который позволяет создавать универсальные кросс-платформенные ссылки. Теперь вы можете открыть Google maps в интернете, Android или iOS, используя ту же строку URL в форме:

есть несколько режимов, которые вы можете использовать: поиск, направления, показать карту и показать вид на улицу.

Так что вы можете использовать что-то вроде

открыть карту и разместить маркер на некоторых лат и сжиженный природный газ.

для получения дополнительной информации, пожалуйста, обратитесь к:

это текущий принятый способ ссылки на определенный lat lon (а не поиск ближайшего объекта).

  • z уровень увеличения (1-20)
  • t — тип карты (Карта» m», спутник» k», гибрид» h», местность» p», » E » GoogleEarth)
  • q — это поисковый запрос, если он не начинается с loc: тогда google предполагает, что это lat lon, разделенный +

да у меня был тот же вопрос в течение длительного времени, и я нашел идеальный один. вот некоторые параметры из него.

q=

используется для указания поискового запроса в Google maps search.
например :

у=

используется для указания альтернативного местоположения q= . Также имеет дополнительный эффект, позволяющий увеличить значение точности AddressDetails, будучи больше точный. В основном только полезно, если запрос бизнес и так далее.

z=

масштаб. Может быть установлен 19 нормально, но в некоторых случаях может идти до 23.

ll=

широта и долгота центра карты. Должны быть в таком порядке. Требуется десятичный формат. Интересно, что вы можете использовать это без Q, в этом случае он не показывает маркер.

sll=

подобно ll, только это устанавливает lat / long центральной точки для бизнес-поиска. Требует тех же входных критериев, что и ll.

t=

устанавливает вид отображаемой карты. Можно установить в:

saddr=

задает начальную точку для поиска направлений. Вы также можете добавить текст в скобках, чтобы выделить его жирным шрифтом в направлениях боковая панель.

daddr=

устанавливает конечную точку для поиска направлений и снова выделяет жирным шрифтом любой текст, добавленный в скобки.Вы также можете добавить » + to:», который будет установлен через точки. Их можно добавлять несколько раз.

via=

позволяет вставлять через точки в направлениях. Должно быть в формате CSV. Например, via=1,5 адреса 1 и 5 будут через точки без записей на боковой панели. Начальная точка (которая установлена как 0), и 2, 3 и 4 будут показывать полные адреса.

doflg=

изменяет единицы измерения расстояния (по умолчанию используется стандартная единица измерения в стране происхождения). Изменить на ptk для метрических или ptm для imperial.

msa=

делает вещи с моими картами. Установите значение 0 показать определенные Мои карты, b включить боковую панель «Мои карты», 1 открыть вкладку «Мои карты» самостоятельно или 2 Перейти к новой Форма создателя карты.

dirflg=

можно установить различные значения ниже:

Это должно помочь с новыми картами Google:

  • ‘место’ добавляет маркер.
  • » имя «может быть поисковым термином, таким как»риэлторы»/»юристы».
  • lat и long-это координаты в десятичном формате и в этом порядке.
  • 15z устанавливает уровень масштабирования до 15 (между 1

просто используйте координаты как q -параметр. Раздень z и t prameters. В то время как z на самом деле должен быть только уровень масштабирования, кажется, что он не будет работать, если вы установите его.

t — Это тип карты. Сказав это, не очевидно, как эти параметры повлияют на результат показанным способом. Но они знают.

может быть, вам стоит попробовать ll -параметр, но будет принят только десятичный формат.

вы можете найти краткий обзор всех параметров здесь.

следующие работы по состоянию на апрель 2014 года. Разграничение каждого компонента URL-адреса с помощью + и & для пробелов и операторов сложения, соответственно.

где ?q= запускает общий поиск, который я предоставляю информацию о месте, городе, провинции, используя + для пространства.

далее гео-данных. Лат и СПГ.

требуется для iframes:

все ответы не работали для меня (loc: и @ options). Так вот мое решение для новых карт Google (апрель 2014 года)

используйте q= для описания запроса, например, улицу или название места. Используйте ll= для lat, длинных координат.

вы можете добавить дополнительные параметры, такие как t=h (hybrid) и z=19 (zoom)

Если вам нужно имя на pin-код, вы также можете использовать:

был ряд изменений, некоторые несовместимые, так как я задал этот вопрос 5 лет назад. В настоящее время правильно работает следующее:

первые широта / долгота будут использованы для положения и ярлыка Штыря. Это может быть в градусах-минутах-секундах, градусах-минутах или градусах. Вторая широта / долгота (после»@») — это центр карты. Он должен быть в градусах только для того, чтобы зум (12z) был распознан.

для вида местности, вы можно добавить » data=!4м2!3м1!1s0x0:0x0 в!5м1!1e4″. Однако я не могу найти документацию по этому вопросу, поэтому спецификация может измениться.

How do I get a direct link to a place on google maps with the Place Id

I have the Place Id of a place on google maps in my app. Is there a way to put the place Id in a URL and have it directly link to the page? Or does it have to be done through the URL?

I can’t seem to find anything detailing this in the docs. I’ve tried below, but it just gets me the standard google maps page:

xomena's user avatar

4 Answers 4

Recently, in May 2017, Google launched the new Google Maps URLs API. You can read about this API in the official documentation

So, from now on you can construct a URL for Google Maps using the place ID. In your particular case this URL will be

Hope this helps!

xomena's user avatar

The URL for a specific Google Place is returned by the places details API endpoint.

If for example you query:

You will see that in the returned JSON there is a key ‘url’ which points to https://maps.google.com/?cid=8148660811851344661

Thomas Clowes's user avatar

Not directly, using the placeID you can get a variety of information in JSON or XML format, among them there are also the lat lng of the place and its address with which you can easily locate the map google developer doc

The correct format, at this time, to produce a general link that goes directly to correct google place is: https://maps.google.com/?cid=[place_id]&t=[maptype]

The map type parameter «t» is apparently necessary. Without it, google maps seems to perform a more general search when the link opens that is sometimes successful and sometimes not. With it, maps opens to correct place each time whether it opens in browser or in app on mobile.

Set this parameter to «m» for a street map and «k» for a satellite map.

A lot of answers on SO show the following syntax which often pulls unwanted results if two locations of the same name are nearby e.g.: https://www.google.com/maps/place/Starbucks/@43.088554,-88.06579,17z/

If you are already using google places api, then you have the place_id, so i recommend using it to avoid ambiguity.

Get Started

Using Maps URLs, you can build a universal, cross-platform URL to launch Google Maps and perform searches, get directions and navigation, and display map views and panoramic images. The URL syntax is the same regardless of the platform in use.

You don’t need a Google API key to use Maps URLs.

Universal cross-platform syntax

As a developer of an Android app, an iOS app, or a website, you can construct a common URL, and it will open Google Maps and perform the requested action, no matter the platform in use when the map is opened.

  • On an Android device:
    • If Google Maps app for Android is installed and active, the URL launches Google Maps in the Maps app and performs the requested action.
    • If the Google Maps app is not installed or is disabled, the URL launches Google Maps in a browser and performs the requested action.
    • If Google Maps app for iOS is installed, the URL launches Google Maps in the Maps app and performs the requested action.
    • If the Google Maps app is not installed, the URL launches Google Maps in a browser and performs the requested action.

    It is recommended that you use a cross-platform URL to launch Google Maps from your app or website, since these universal URLs allow for broader handling of the maps requests no matter the platform in use. For features that may only be functional on a mobile platform (for example, turn-by-turn navigation), you may prefer to use a platform-specific option for Android or iOS. See the following documentation:

    • Google Maps Intents for Android — specifically to launch the Google Maps app for Android
    • Google Maps URL Scheme for iOS — specifically to launch the Google Maps app for iOS

    Launching Google Maps and performing a specific action

    To launch Google Maps and optionally perform one of the supported functions, use a URL scheme of one of the following forms, depending on the action requested:

      — launch a Google Map that displays a pin for a specific place, or perform a general search and launch a map to display the results:
      https://www.google.com/maps/search/?api=1 &parameters — request directions and launch Google Maps with the results:
      https://www.google.com/maps/dir/?api=1 &parameters — launch Google Maps with no markers or directions:
      https://www.google.com/maps/@?api=1&map_action=map &parameters — launch an interactive panorama image:
      https://www.google.com/maps/@?api=1&map_action=pano &parameters

    Important: The parameter api=1 identifies the version of Maps URLs this URL is intended for. This parameter is required in every request. The only valid value is 1. If api=1 is NOT present in the URL, all parameters are ignored and the default Google Maps app will launch, either in a browser or the Google Maps mobile app, depending on the platform in use (for example, https://www.google.com/maps).

    Constructing valid URLs

    For example, some parameters use a pipe character ( | ) as a separator, which you must encode as %7C in the final URL. Other parameters use comma-separated values, such as latitude/longitude coordinates or City, State. You must encode the comma as %2C . Encode spaces with %20 , or replace them with a plus sign ( + ).

    Additionally, URLs are limited to 2,048 characters for each request. Be aware of this limit when constructing your URLs.

    Map actions

    The map actions available are: search, directions, display a map, and display a Street View panorama. You specify the action in the request URL, along with required and optional parameters. As is standard in URLs, you separate parameters using the ampersand ( & ) character. For each action, the list of parameters and their possible values are enumerated in the Search Parameters section.

    Search

    The search action displays results for a search across the visible map region. When searching for a specific place, the resulting map puts a pin in the specified location and displays available place details.

    Forming the Search URL
    Parameters
    • query (required): Defines the place(s) to highlight on the map. The query parameter is required for all search requests.
      • Specify locations as either a place name, address, or comma-separated latitude/longitude coordinates. Strings should be URL-encoded, so an address such as «City Hall, New York, NY» should be converted to City+Hall%2C+New+York%2C+NY .
      • Specify general search terms as a URL-encoded string, such as grocery+stores or restaurants+in+seattle+wa .
      Search examples

      Location search

      In a location search, you search for a specific location using a place name, address, or comma-separated latitude/longitude coordinates, and the resulting map displays a pin at that location. These three examples illustrate searches for the same location, CenturyLink Field (a sports stadium in Seattle, WA), using different location values.

      Example 1: Searching for the place name «CenturyLink Field» results in the following map:

      Example 2: Searching for CenturyLink Field using latitude/longitude coordinates as well as the place ID results in the following map:

      Example 3: Searching for CenturyLink Field using only latitude/longitude coordinates results in the following map. Notice that there is a pin in the map, but no additional place information is provided on the map or in the side panel:

      Categorical search

      In a categorical search, you pass a general search term, and Google Maps attempts to find listings that match your criteria near the location you specify. If no location is specified, Google Maps attempts to find listings nearby your current location. If you prefer to provide a location for a categorical search, include the location in the general search string (for example, pizza+seattle+wa ).

      In this example, a search for pizza restaurants in Seattle, WA, results in the following map:

      Directions

      Directions action displays the path between two or more specified points on the map, as well as the distance and travel time.

      Forming the Directions URL
      Parameters
      • origin : Defines the starting point from which to display directions. Defaults to most relevant starting location, such as device location, if available. If none, the resulting map may provide a blank form to allow a user to enter the origin. The value can be either a place name, address, or comma-separated latitude/longitude coordinates. A string should be URL-encoded, so an address such as «City Hall, New York, NY» should be converted to City+Hall%2C+New+York%2C+NY .

      Note: This parameter is optional, unless you specify an origin_place_id in your URL. If you choose to specify an origin_place_id , you must also include an origin in the URL.

      Note: This parameter is optional, unless you specify a destination_place_id in your URL. If you choose to specify a destination_place_id , you must also include a destination in the URL.

      Notes:

      • Waypoints are not supported on all Google Maps products; in those cases this parameter will be ignored.
      • This parameter is optional, unless you specify waypoint_place_ids in your URL. If you choose to specify waypoint_place_ids , you must also include waypoints in the URL.
      Directions examples

      The following URL launches a map in directions mode and provides a form to allow the user to enter the origin and destination.

      The following example launches a map with bicycling directions from the Space Needle to Pike Place Market, in Seattle, WA.

      The following example launches a map with walking directions from Google in Sydney, Australia, to the Queen Victoria Building.

      Displaying a map

      The map action returns a map with no markers or directions.

      Forming the map URL
      Parameters
      • map_action=map (required): Specifies the type of map view to display. Maps and Street View share the same endpoint. To ensure a map is displayed, the map_action must be specified as map .
      • center (optional): Defines the center of the map window, and accepts latitude/longitude coordinates as comma-separated values (for example, -33.8569,151.2152 ).
      • zoom (optional): Sets the initial zoom level of the map. Accepted values are whole integers ranging from 0 (the whole world) to 21 (individual buildings). The upper limit can vary depending on the map data available at the selected location. The default is 15.
      • basemap (optional): Defines the type of map to display. The value can be either roadmap (default), satellite , or terrain .
      • layer (optional): Defines an extra layer to display on the map, if any. The value can be one of the following: none (default), transit , traffic , or bicycling .
      Map examples

      This example URL launches a default Google Map, centered on the user’s current location.

      The following example displays a map centered on Katoomba, NSW, Australia (at -33.712206,150.311941 ), and sets the optional zoom and basemap parameters.

      Displaying a Street View panorama

      The pano action lets you launch a viewer to display Street View images as interactive panoramas. Each Street View panorama provides a full 360-degree view from a single location. Images contain 360 degrees of horizontal view (a full wrap-around) and 180 degrees of vertical view (from straight up to straight down). The pano action launches a viewer that renders the resulting panorama as a sphere with a camera at its center. You can manipulate the camera to control the zoom and the orientation of the camera.

      Google Street View provides panoramic views from designated locations throughout its coverage area. User contributed Photospheres and Street View special collections are also available.

      Forming the Street View URL
      Parameters
      • map_action=pano (required): Specifies the type of view to display. Maps and Street View share the same endpoint. To ensure a panorama is displayed, the action must be specified as pano .

      One of the following URL parameters is also required:

      • viewpoint : The viewer displays the panorama photographed closest to the viewpoint location, specified as comma-separated latitude/longitude coordinates (for example 46.414382,10.013988). Because Street View imagery is periodically refreshed, and photographs may be taken from slightly different positions each time, it’s possible that your location may snap to a different panorama when imagery is updated.
      • pano : The specific panorama ID of the image to display. If you specify a pano you may also specify a viewpoint . The viewpoint is only used if Google Maps cannot find the panorama ID. If pano is specified but not found, and a viewpoint is NOT specified, no panorama image is displayed. Instead, Google Maps opens in default mode, displaying a map centered on the user’s current location.

      The following URL parameters are optional:

      • heading : Indicates the compass heading of the camera in degrees clockwise from North. Accepted values are from -180 to 360 degrees. If omitted, a default heading is chosen based on the viewpoint (if specified) of the query and the actual location of the image.
      • pitch : Specifies the angle, up or down, of the camera. The pitch is specified in degrees from -90 to 90. Positive values will angle the camera up, while negative values will angle the camera down. The default pitch of 0 is set based on on the position of the camera when the image was captured. Because of this, a pitch of 0 is often, but not always, horizontal. For example, an image taken on a hill will likely exhibit a default pitch that is not horizontal.
      • fov : Determines the horizontal field of view of the image. The field of view is expressed in degrees, with a range of 10 — 100. It defaults to 90. When dealing with a fixed-size viewport, the field of view is considered the zoom level, with smaller numbers indicating a higher level of zoom.
      Street View examples

      The first two examples display a panorama of the Eiffel Tower. Example one uses only a viewpoint for the location, and sets the optional heading , pitch , and fov parameters. For comparison, example two uses a pano ID as well as the same parameters set in the first example. The third example displays an indoor panorama image.

      Example 1: Uses only a viewpoint to specify location.

      Example 2: Uses a pano ID as well as a viewpoint location. The pano ID takes precedence over the viewpoint . In this example, the panorama ID is found, so the viewpoint is ignored. Notice that the panorama image that is displayed for the pano ID is slightly different, and more recent, than the image found using only the viewpoint .

      Example 3: Displays a panorama of the interior of the Sarastro restaurant in London, UK, specified with a panorama ID.

      Finding a panorama ID

      To find the ID of a specific panorama image, there are multiple methods you can use.

      • For JavaScript, use the StreetViewPanorama class.
      • For Android, use the public class StreetViewPanoramaLocation.
      • For iOS, use the GMSPanorama class.
      • You may also make metadata requests using the Google Street View Image API. Image metadata requests provide data about Street View panoramas, including the panorama ID.

      More examples

      Directions examples using waypoints

      The following directions examples launch Google Maps and display driving directions from Paris, France to Cherbourg, France, routing through the following waypoints:

      City, Country Place Name Place ID
      1. Versailles, France The Palace of Versailles ChIJdUyx15R95kcRj85ZX8H8OAU
      2. Chartres, France Chartres Cathedral ChIJKzGHdEgM5EcR_OBTT3nQoEA
      3. Le Mans, France Cathedral of Saint Julian of Le Mans ChIJG2LvQNCI4kcRKXNoAsPi1Mc
      4. Caen, France Caen Castle ChIJ06tnGbxCCkgRsfNjEQMwUsc

      In the example URLs, the waypoints are defined in different ways so you can compare the differences in the display of the waypoints on the resulting maps.

      Example 1: Waypoints defined as City, Country:

      Example 2: Waypoints defined as specific place names:

      Example 3: Waypoints defined as City, Country, and also provides waypoint_place_ids for a specific establishment in each waypoint:

      Example 4: Defines waypoints as City, Country, but lists the waypoints in a different order compared to the previous examples. Demonstrates that the map displays waypoints in the order they are listed in the URL.

      Map examples

      Displays a map with a specified basemap (satellite) and layer (transit).

      Street View examples

      Displays a Street View panorama using a FIFE image key as the pano ID. Note that the pano ID is prefaced with F:.

      Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *