PlaceContentConfigElement class
class
google.maps.places.PlaceContentConfigElement
extends HTMLElement
implements PlaceContentConfigElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać niestandardowy zestaw treści. Aby go użyć, dołącz go jako element podrzędny.
W przypadku PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement dołącz dowolny z tych elementów do PlaceContentConfigElement, aby wyświetlić odpowiednie treści:
PlaceAddressElement, PlaceAccessibleEntranceIconElement, PlaceAttributionElement PlaceMediaElement, PlaceOpenNowStatusElement, PlacePriceElement, PlaceRatingElement, PlaceTypeElement.
W przypadku PlaceDetailsElement możesz też dołączyć dowolny z tych elementów:
PlaceFeatureListElement PlaceOpeningHoursElement, PlacePhoneNumberElement, PlacePlusCodeElement, PlaceReviewSummaryElement, PlaceReviewsElement, PlaceSummaryElement, PlaceTypeSpecificHighlightsElement, PlaceWebsiteElement.
Kolejność elementów podrzędnych nie ma znaczenia. Element renderuje treści w standardowej kolejności, której nie można dostosować. Przykład:
<gmp-place-details>
<gmp-place-content-config>
<gmp-place-media lightbox-preferred></gmp-place-media>
<gmp-place-address></gmp-place-address>
</gmp-place-content-config>
</gmp-place-details> <gmp-place-content-config></gmp-place-content-config>
const {PlaceContentConfigElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceContentConfigElement |
PlaceContentConfigElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceContentConfigElementOptions interface
interfejs
google.maps.places.PlaceContentConfigElementOptions
zaimplementowany przez PlaceContentConfigElement
Opcje dotyczące: PlaceContentConfigElement.
PlaceAllContentElement
class
google.maps.places.PlaceAllContentElement
extends HTMLElement
implements PlaceAllContentElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać wszystkie dostępne treści. Aby go użyć, dołącz go jako element podrzędny. Na przykład:
<gmp-place-details>
<gmp-place-all-content></gmp-place-all-content>
</gmp-place-details>
<gmp-place-all-content></gmp-place-all-content>
const {PlaceAllContentElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceAllContentElement |
PlaceAllContentElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Interfejs PlaceAllContentElementOptions
interfejs
google.maps.places.PlaceAllContentElementOptions
zaimplementowany przez PlaceAllContentElement
Opcje dotyczące: PlaceAllContentElement.
PlaceStandardContentElement
class
google.maps.places.PlaceStandardContentElement
extends HTMLElement
implements PlaceStandardContentElementOptions
library "places"
Konfiguruje urządzenie PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement tak, aby wyświetlało standardowy zestaw treści. Aby go użyć, dołącz go jako element podrzędny.
W przypadku PlaceDetailsElement treści standardowe obejmują:
- media
- adres
- ocena
- typ
- cena
- ikona wejścia dostępnego dla osób z niepełnosprawnością
- witryna
- numer telefonu
- godziny otwarcia
- podsumowanie
- wyróżnienia dotyczące konkretnego typu
- opinie
- lista funkcji
W przypadku
PlaceDetailsCompactElement standardowe treści obejmują: - media
- ocena
- typ
- cena
- ikona wejścia dostępnego dla osób z niepełnosprawnością
- stan „teraz otwarte”
W przypadku
PlaceSearchElement standardowe treści obejmują: - media
- ocena
- typ
- cena
- ikona wejścia dostępnego dla osób z niepełnosprawnością
Na przykład:
<gmp-place-details>
<gmp-place-standard-content></gmp-place-standard-content>
</gmp-place-details>
<gmp-place-standard-content></gmp-place-standard-content>
const {PlaceStandardContentElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceStandardContentElement |
PlaceStandardContentElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceStandardContentElementOptions interface
interfejs
google.maps.places.PlaceStandardContentElementOptions
zaimplementowany przez PlaceStandardContentElement
Opcje dotyczące: PlaceStandardContentElement.
PlaceMediaElement
class
google.maps.places.PlaceMediaElement
extends HTMLElement
implements PlaceMediaElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać multimedia dotyczące miejsca, takie jak zdjęcia. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-media lightbox-preferred></gmp-place-media>
</gmp-place-content-config>
<gmp-place-media lightbox-preferred preferred-size="value-name"> </gmp-place-media>
const {PlaceMediaElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceMediaElement |
PlaceMediaElement([options])Parametry:
|
Właściwości | |
|---|---|
lightboxPreferred
attr: lightbox-preferred |
Typ danych wejściowych:
boolean optionalTyp danych wyjściowych: booleanDomyślnie:
falseOkreśla, czy włączyć, czy wyłączyć lightbox multimediów, jeśli obie opcje są obsługiwane.
Atrybut HTML: lightbox-preferred |
preferredSize
attr: preferred-size |
Domyślnie:
nullPreferowany rozmiar multimediów w przypadkach, gdy obsługiwanych jest wiele rozmiarów, np. pionowy
PlaceSearchElement. Jeśli nie zostanie to określone, branża PlaceSearchElement będzie domyślnie używać modelu MediaSize.SMALL.Atrybut HTML: preferred-size="value-name" |
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceMediaElementOptions interface
interfejs
google.maps.places.PlaceMediaElementOptions
zaimplementowany przez PlaceMediaElement
Opcje dotyczące: PlaceMediaElement.
Właściwości | |
|---|---|
lightboxPreferred
opcjonalne |
Typ:
boolean optional |
preferredSize
opcjonalne |
Typ:
MediaSize optionalZobacz PlaceMediaElement.preferredSize. |
MediaSize constants
stałe
google.maps.places.MediaSize
biblioteka "places"
Preferowany rozmiar multimediów w przypadkach, gdy obsługiwanych jest wiele rozmiarów, np. pionowy PlaceSearchElement.
Te stałe mogą być też używane jako ciągi znaków. W języku TypeScript literały ciągów znaków są definiowane przez typ MediaSizeString.
const {MediaSize} = await google.maps.importLibrary("places");
Stałe | |
|---|---|
LARGE |
Duży rozmiar multimediów. |
MEDIUM |
Średni rozmiar multimediów. |
SMALL |
Mały rozmiar multimediów. |
Klasa PlaceAddressElement
class
google.maps.places.PlaceAddressElement
extends HTMLElement
implements PlaceAddressElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać adres miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-address></gmp-place-address>
</gmp-place-content-config>
<gmp-place-address></gmp-place-address>
const {PlaceAddressElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceAddressElement |
PlaceAddressElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceAddressElementOptions interface
interfejs
google.maps.places.PlaceAddressElementOptions
zaimplementowany przez PlaceAddressElement
Opcje dotyczące: PlaceAddressElement.
PlaceRatingElement
class
google.maps.places.PlaceRatingElement
extends HTMLElement
implements PlaceRatingElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać ocenę miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-rating></gmp-place-rating>
</gmp-place-content-config>
<gmp-place-rating></gmp-place-rating>
const {PlaceRatingElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceRatingElement |
PlaceRatingElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceRatingElementOptions interface
interfejs
google.maps.places.PlaceRatingElementOptions
zaimplementowany przez PlaceRatingElement
Opcje dotyczące: PlaceRatingElement.
Klasa PlaceTypeElement
class
google.maps.places.PlaceTypeElement
extends HTMLElement
implements PlaceTypeElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać typ miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-type></gmp-place-type>
</gmp-place-content-config>
<gmp-place-type></gmp-place-type>
const {PlaceTypeElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceTypeElement |
PlaceTypeElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceTypeElementOptions interface
interfejs
google.maps.places.PlaceTypeElementOptions
zaimplementowany przez PlaceTypeElement
Opcje dotyczące: PlaceTypeElement.
Klasa PlacePriceElement
class
google.maps.places.PlacePriceElement
extends HTMLElement
implements PlacePriceElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać poziom cen lub przedział cenowy miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-price></gmp-place-price>
</gmp-place-content-config>
<gmp-place-price></gmp-place-price>
const {PlacePriceElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlacePriceElement |
PlacePriceElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlacePriceElementOptions interface
interfejs
google.maps.places.PlacePriceElementOptions
zaimplementowany przez PlacePriceElement
Opcje dotyczące: PlacePriceElement.
Klasa PlaceAccessibleEntranceIconElement
class
google.maps.places.PlaceAccessibleEntranceIconElement
extends HTMLElement
implements PlaceAccessibleEntranceIconElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać ikonę wózka inwalidzkiego, jeśli miejsce ma wejście z ułatwieniami dostępu. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
</gmp-place-content-config>
<gmp-place-accessible-entrance-icon></gmp-place-accessible-entrance-icon>
const {PlaceAccessibleEntranceIconElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceAccessibleEntranceIconElement |
PlaceAccessibleEntranceIconElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Interfejs PlaceAccessibleEntranceIconElementOptions
interfejs
google.maps.places.PlaceAccessibleEntranceIconElementOptions
zaimplementowany przez PlaceAccessibleEntranceIconElement
Opcje dotyczące: PlaceAccessibleEntranceIconElement.
PlaceOpenNowStatusElement
class
google.maps.places.PlaceOpenNowStatusElement
extends HTMLElement
implements PlaceOpenNowStatusElementOptions
library "places"
Konfiguruje PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement, aby wyświetlać aktualny stan otwarcia lub zamknięcia miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-open-now-status></gmp-place-open-now-status>
</gmp-place-content-config>
<gmp-place-open-now-status></gmp-place-open-now-status>
const {PlaceOpenNowStatusElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceOpenNowStatusElement |
PlaceOpenNowStatusElement([options])Parametry:
|
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceOpenNowStatusElementOptions interface
interfejs
google.maps.places.PlaceOpenNowStatusElementOptions
zaimplementowany przez PlaceOpenNowStatusElement
Opcje dotyczące: PlaceOpenNowStatusElement.
PlaceReviewSummaryElement class
class
google.maps.places.PlaceReviewSummaryElement
extends HTMLElement
implements PlaceReviewSummaryElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać podsumowanie opinii o miejscu. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-review-summary></gmp-place-review-summary>
</gmp-place-content-config>
<gmp-place-review-summary></gmp-place-review-summary>
const {PlaceReviewSummaryElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceReviewSummaryElementOptions interface
interfejs
google.maps.places.PlaceReviewSummaryElementOptions
zaimplementowany przez PlaceReviewSummaryElement
Opcje dotyczące: PlaceReviewSummaryElement.
PlaceReviewsElement
class
google.maps.places.PlaceReviewsElement
extends HTMLElement
implements PlaceReviewsElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać opinie o miejscu. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-reviews></gmp-place-reviews>
</gmp-place-content-config>
<gmp-place-reviews></gmp-place-reviews>
const {PlaceReviewsElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceReviewsElementOptions interface
interfejs
google.maps.places.PlaceReviewsElementOptions
zaimplementowany przez PlaceReviewsElement
Opcje dotyczące: PlaceReviewsElement.
PlaceSummaryElement
class
google.maps.places.PlaceSummaryElement
extends HTMLElement
implements PlaceSummaryElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać podsumowanie miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-summary></gmp-place-summary>
</gmp-place-content-config>
<gmp-place-summary></gmp-place-summary>
const {PlaceSummaryElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceSummaryElementOptions interface
interfejs
google.maps.places.PlaceSummaryElementOptions
zaimplementowany przez PlaceSummaryElement
Opcje dotyczące: PlaceSummaryElement.
PlaceFeatureListElement
class
google.maps.places.PlaceFeatureListElement
extends HTMLElement
implements PlaceFeatureListElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać listę funkcji miejsca na karcie „Informacje”. Lista funkcji może obejmować opcje ułatwień dostępu, udogodnienia, akceptowane formy płatności i inne informacje. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-feature-list></gmp-place-feature-list>
</gmp-place-content-config>
<gmp-place-feature-list></gmp-place-feature-list>
const {PlaceFeatureListElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Interfejs PlaceFeatureListElementOptions
interfejs
google.maps.places.PlaceFeatureListElementOptions
zaimplementowany przez PlaceFeatureListElement
Opcje dotyczące: PlaceFeatureListElement.
Klasa PlaceOpeningHoursElement
class
google.maps.places.PlaceOpeningHoursElement
extends HTMLElement
implements PlaceOpeningHoursElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać godziny otwarcia miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-opening-hours></gmp-place-opening-hours>
</gmp-place-content-config>
<gmp-place-opening-hours></gmp-place-opening-hours>
const {PlaceOpeningHoursElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceOpeningHoursElementOptions interface
interfejs
google.maps.places.PlaceOpeningHoursElementOptions
zaimplementowany przez PlaceOpeningHoursElement
Opcje dotyczące: PlaceOpeningHoursElement.
PlacePhoneNumberElement class
class
google.maps.places.PlacePhoneNumberElement
extends HTMLElement
implements PlacePhoneNumberElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać numer telefonu miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-phone-number></gmp-place-phone-number>
</gmp-place-content-config>
<gmp-place-phone-number></gmp-place-phone-number>
const {PlacePhoneNumberElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Interfejs PlacePhoneNumberElementOptions
interfejs
google.maps.places.PlacePhoneNumberElementOptions
zaimplementowany przez PlacePhoneNumberElement
Opcje dotyczące: PlacePhoneNumberElement.
PlacePlusCodeElement class
class
google.maps.places.PlacePlusCodeElement
extends HTMLElement
implements PlacePlusCodeElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać plus code miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-plus-code></gmp-place-plus-code>
</gmp-place-content-config>
<gmp-place-plus-code></gmp-place-plus-code>
const {PlacePlusCodeElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Interfejs PlacePlusCodeElementOptions
interfejs
google.maps.places.PlacePlusCodeElementOptions
zaimplementowany przez PlacePlusCodeElement
Opcje dotyczące: PlacePlusCodeElement.
PlaceTypeSpecificHighlightsElement class
class
google.maps.places.PlaceTypeSpecificHighlightsElement
extends HTMLElement
implements PlaceTypeSpecificHighlightsElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać najważniejsze informacje o miejscu, takie jak ceny paliwa i dostępność ładowarek EV. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
</gmp-place-content-config>
<gmp-place-type-specific-highlights></gmp-place-type-specific-highlights>
const {PlaceTypeSpecificHighlightsElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceTypeSpecificHighlightsElementOptions interfejs
interfejs
google.maps.places.PlaceTypeSpecificHighlightsElementOptions
zaimplementowany przez PlaceTypeSpecificHighlightsElement
Opcje dotyczące: PlaceTypeSpecificHighlightsElement.
PlaceWebsiteElement class
class
google.maps.places.PlaceWebsiteElement
extends HTMLElement
implements PlaceWebsiteElementOptions
library "places"
Konfiguruje PlaceDetailsElement, aby wyświetlać witrynę miejsca. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Na przykład:
<gmp-place-content-config>
<gmp-place-website></gmp-place-website>
</gmp-place-content-config>
<gmp-place-website></gmp-place-website>
const {PlaceWebsiteElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceWebsiteElementOptions interface
interfejs
google.maps.places.PlaceWebsiteElementOptions
zaimplementowany przez PlaceWebsiteElement
Opcje dotyczące: PlaceWebsiteElement.
Klasa PlaceAttributionElement
class
google.maps.places.PlaceAttributionElement
extends HTMLElement
implements PlaceAttributionElementOptions
library "places"
Umożliwia dostosowanie tekstu informacji o pochodzeniu danych w Mapach Google w PlaceDetailsCompactElement, PlaceDetailsElement lub PlaceSearchElement. Aby użyć tego elementu, dołącz go jako element podrzędny elementu PlaceContentConfigElement. Jeśli pominiesz ten element, atrybucja będzie nadal wyświetlana z kolorami domyślnymi. Na przykład:
<gmp-place-content-config>
<gmp-place-attribution
light-scheme-color="black"
dark-scheme-color="white"
></gmp-place-attribution>
</gmp-place-content-config>
<gmp-place-attribution dark-scheme-color="value-name" light-scheme-color="value-name"> </gmp-place-attribution>
const {PlaceAttributionElement} = await google.maps.importLibrary("places");
Zespół | |
|---|---|
PlaceAttributionElement |
PlaceAttributionElement([options])Parametry:
|
Właściwości | |
|---|---|
darkSchemeColor
attr: dark-scheme-color |
Domyślnie:
AttributionColor.WHITEKolor atrybucji Map Google w trybie ciemnym.
Atrybut HTML: dark-scheme-color="value-name" |
lightSchemeColor
attr: light-scheme-color |
Domyślnie:
AttributionColor.GRAYKolor atrybucji Map Google w trybie jasnym.
Atrybut HTML: light-scheme-color="value-name" |
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceAttributionElementOptions interface
interfejs
google.maps.places.PlaceAttributionElementOptions
zaimplementowany przez PlaceAttributionElement
Opcje dotyczące: PlaceAttributionElement.
Właściwości | |
|---|---|
darkSchemeColor
opcjonalne |
Typ:
AttributionColor optional |
lightSchemeColor
opcjonalne |
Typ:
AttributionColor optional |
AttributionColor stałe
stałe
google.maps.places.AttributionColor
biblioteka "places"
Opcje kolorów tekstu informacji o pochodzeniu danych w Mapach Google. Atrybucję można dostosować, aby używać dowolnego z tych kolorów.
Te stałe mogą być też używane jako ciągi znaków. W języku TypeScript literały ciągów znaków są definiowane przez typ AttributionColorString.
const {AttributionColor} = await google.maps.importLibrary("places");
Stałe | |
|---|---|
BLACK |
Czarna informacja o pochodzeniu danych. |
GRAY |
Szary tekst informacji o pochodzeniu danych. |
WHITE |
Biały tekst informacji o pochodzeniu danych. |
Klasa PlaceButtonElement
class
google.maps.places.PlaceButtonElement
extends HTMLElement
implements PlaceButtonElementOptions
library "places"
Wyświetla przycisk umieszczony w boksie action-main lub action-corner. PlaceButtonElement nie ma działania domyślnego. Dołącz do elementu detektor zdarzeń, aby zdefiniować jego zachowanie. Domyślnie przycisk będzie wyświetlany w miejscu action-main.
<gmp-place-button action-aria-label="string" label="string"> </gmp-place-button>
const {PlaceButtonElement} = await google.maps.importLibrary("places");
Właściwości | |
|---|---|
actionAriaLabel
attr: action-aria-label |
Typ:
string optionalDomyślnie:
undefinedEtykieta ARIA elementu sterującego wewnętrznego. Elementy sterujące zawierające tylko ikonę powinny zawsze mieć atrybut aria-label opisujący ich przeznaczenie i działanie. Elementy sterujące renderowane w rogu nie wyświetlają etykiety, dlatego zalecamy używanie atrybutu aria-label zamiast etykiety.
Atrybut HTML: action-aria-label="string" |
label
attr: label |
Typ:
string optionalDomyślnie:
undefinedEtykieta, która ma się wyświetlać w elemencie sterującym. W przypadku linków ze wstępnie zdefiniowanymi typami działań ten atrybut jest ignorowany. Linki i przyciski renderowane w miejscu na róg działania nie wyświetlają etykiety. W przypadku elementów sterujących w narożnikach zalecamy używanie atrybutu
action-aria-label.Atrybut HTML: label="string" |
Przedziały | |
|---|---|
icon-start |
Miejsce na ikonę, która zaczyna się przed etykietą. Jest on używany zarówno w przypadku głównych, jak i narożnych elementów sterujących. Gdy element sterujący zostanie zwinięty do stanu narożnego, wyświetlana jest zawartość tego boksu. |
Części | |
|---|---|
button |
Część CSS, która jest kierowana na wewnętrzny element sterujący. |
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Wydarzenia | |
|---|---|
gmp-click |
function(event)Argumenty:
Uruchamiane po kliknięciu elementu sterującego. |
Interfejs PlaceButtonElementOptions
interfejs
google.maps.places.PlaceButtonElementOptions
zaimplementowany przez PlaceButtonElement
Opcje dotyczące: PlaceButtonElement.
Właściwości | |
|---|---|
actionAriaLabel
opcjonalne |
Typ:
string optionalEtykieta ARIA elementu sterującego wewnętrznego. Elementy sterujące zawierające tylko ikonę powinny zawsze mieć atrybut aria-label opisujący ich przeznaczenie i działanie. Elementy sterujące renderowane w rogu nie wyświetlają etykiety, dlatego zalecamy używanie atrybutu aria-label zamiast etykiety. |
label
opcjonalne |
Typ:
string optionalEtykieta, która ma się wyświetlać w elemencie sterującym. W przypadku linków ze wstępnie zdefiniowanymi typami działań ten atrybut jest ignorowany. Linki i przyciski renderowane w miejscu na róg działania nie wyświetlają etykiety. W przypadku elementów sterujących w narożnikach zalecamy używanie atrybutu action-aria-label. |
Klasa PlaceLinkElement
class
google.maps.places.PlaceLinkElement
extends HTMLElement
implements PlaceLinkElementOptions
library "places"
Wyświetla link umieszczony w slocie action-main lub action-corner. Domyślnie link będzie wyświetlany w miejscu action-main. Aby określić działanie linku, użyj atrybutu action. Dostępnych jest kilka typów działań, które są wymienione w ActionLinkType. W przypadku linku niestandardowego określ typ działania custom i ustaw atrybuty href i label.
<gmp-place-link action="value-name" action-aria-label="string" href="string" label="string" target="string"> </gmp-place-link>
const {PlaceLinkElement} = await google.maps.importLibrary("places");
Właściwości | |
|---|---|
action
attr: action |
Typ:
ActionLinkType optionalTyp działania, które ma zostać wykonane po kliknięciu linku. Określa domyślną etykietę, ikonę i atrybut href miejsca docelowego linku. Aby ręcznie ustawić miejsce docelowe, użyj typu
custom i określ atrybut href.Atrybut HTML: action="value-name" |
actionAriaLabel
attr: action-aria-label |
Typ:
string optionalDomyślnie:
undefinedEtykieta ARIA elementu sterującego wewnętrznego. Elementy sterujące zawierające tylko ikonę powinny zawsze mieć atrybut aria-label opisujący ich przeznaczenie i działanie. Elementy sterujące renderowane w rogu nie wyświetlają etykiety, dlatego zalecamy używanie atrybutu aria-label zamiast etykiety.
Atrybut HTML: action-aria-label="string" |
href
attr: href |
Typ:
string optionalDomyślnie:
undefinedAdres URL, który ma się otworzyć po kliknięciu linku. Ta wartość jest używana tylko wtedy, gdy atrybut
action ma wartość custom.Atrybut HTML: href="string" |
label
attr: label |
Typ:
string optionalDomyślnie:
undefinedEtykieta, która ma się wyświetlać w elemencie sterującym. W przypadku linków ze wstępnie zdefiniowanymi typami działań ten atrybut jest ignorowany. Linki i przyciski renderowane w miejscu na róg działania nie wyświetlają etykiety. W przypadku elementów sterujących w narożnikach zalecamy używanie atrybutu
action-aria-label.Atrybut HTML: label="string" |
target
attr: target |
Typ:
string optionalDomyślnie:
undefinedOkreśla, gdzie otwiera się link. Więcej informacji znajdziesz na stronie https://developer.mozilla.org/en-US/docs/Web/HTML/Element/a#target.
Atrybut HTML: target="string" |
Przedziały | |
|---|---|
icon-start |
Miejsce na ikonę, która zaczyna się przed etykietą. Jest on używany zarówno w przypadku głównych, jak i narożnych elementów sterujących. Gdy element sterujący zostanie zwinięty do stanu narożnego, wyświetlana jest zawartość tego boksu. |
Części | |
|---|---|
button |
Część CSS, która jest kierowana na wewnętrzny element sterujący. |
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
Wydarzenia | |
|---|---|
gmp-click |
function(event)Argumenty:
Uruchamiane po kliknięciu elementu sterującego. |
PlaceLinkElementOptions interface
interfejs
google.maps.places.PlaceLinkElementOptions
zaimplementowany przez PlaceLinkElement
Opcje dotyczące: PlaceLinkElement.
Właściwości | |
|---|---|
action
opcjonalne |
Typ:
ActionLinkType optionalZobacz PlaceLinkElement.action. |
actionAriaLabel
opcjonalne |
Typ:
string optionalEtykieta ARIA elementu sterującego wewnętrznego. Elementy sterujące zawierające tylko ikonę powinny zawsze mieć atrybut aria-label opisujący ich przeznaczenie i działanie. Elementy sterujące renderowane w rogu nie wyświetlają etykiety, dlatego zalecamy używanie atrybutu aria-label zamiast etykiety. |
href
opcjonalne |
Typ:
string optionalZobacz PlaceLinkElement.href. |
label
opcjonalne |
Typ:
string optionalEtykieta, która ma się wyświetlać w elemencie sterującym. W przypadku linków ze wstępnie zdefiniowanymi typami działań ten atrybut jest ignorowany. Linki i przyciski renderowane w miejscu na róg działania nie wyświetlają etykiety. W przypadku elementów sterujących w narożnikach zalecamy używanie atrybutu action-aria-label. |
target
opcjonalne |
Typ:
string optionalZobacz PlaceLinkElement.target. |
ActionLinkType stałe
stałe
google.maps.places.ActionLinkType
biblioteka "places"
Działanie, które wykonuje PlaceLinkElement po kliknięciu. Określa ikonę, etykietę i miejsce docelowe href.
Te stałe mogą być też używane jako ciągi znaków. W języku TypeScript literały ciągów znaków są definiowane przez typ ActionLinkTypeString.
const {ActionLinkType} = await google.maps.importLibrary("places");
Stałe | |
|---|---|
CALL |
Uruchamia link tel:, aby zadzwonić do danego miejsca. Działanie zależy od systemu operacyjnego. |
CUSTOM |
Użyj tego typu działania w przypadku linków niestandardowych. Jeśli używasz tego typu działania, atrybut href musi być ustawiony w PlaceLinkElement. |
OPEN_DIRECTIONS |
Otwiera wskazówki dojazdu do miejsca w lokalizacji określonej przez parametr PlaceLinkElement.target. |
OPEN_MAP |
Otwiera mapę w lokalizacji określonej przez PlaceLinkElement.target. |
OPEN_WEBSITE |
Otwiera witrynę miejsca w lokalizacji określonej przez PlaceLinkElement.target. |
ActionButtonPosition constants
stałe
google.maps.places.ActionButtonPosition
biblioteka "places"
Pozycja elementu sterującego w widżecie informacji o miejscu.
Te stałe mogą być też używane jako ciągi znaków. W języku TypeScript literały ciągów znaków są definiowane przez typ ActionButtonPositionString.
const {ActionButtonPosition} = await google.maps.importLibrary("places");
Stałe | |
|---|---|
ACTION_CORNER |
Element sterujący jest renderowany w rogu widżetu. Elementy sterujące w rogu wyświetlają tylko ikonę. |
ACTION_MAIN |
Element sterujący jest renderowany w głównym obszarze treści widżetu. Etykiety i ikony są renderowane. |
Klasa PlaceActionEvent
class
google.maps.places.PlaceActionEvent
extends Event
library "places"
Zdarzenie wywoływane po kliknięciu przycisku polecenia.
const {PlaceActionEvent} = await google.maps.importLibrary("places");
Właściwości | |
|---|---|
place
readonly |
Typ:
PlaceMiejsce, które zostało kliknięte. |
Klasa PlaceNameElement
class
google.maps.places.PlaceNameElement
extends HTMLElement
implements PlaceNameElementOptions
library "places"
Wyświetla nazwę miejsca w elemencie informacji o miejscu.
<gmp-place-name></gmp-place-name>
const {PlaceNameElement} = await google.maps.importLibrary("places");
Metody | |
|---|---|
Dziedziczone:
addEventListener,
removeEventListener
|
PlaceNameElementOptions interface
interfejs
google.maps.places.PlaceNameElementOptions
zaimplementowany przez PlaceNameElement
Opcje dotyczące: PlaceNameElement.