Ortssymbole
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Ortssymbole kennzeichnen die verschiedenen Arten von Orten, z. B. Cafés, Bibliotheken und Museen. Symbole und die entsprechenden Hintergrundfarben können über die „Place“-Klasse angefordert werden.
Felder
Verwenden Sie für die Arbeit mit Ortssymbolen die folgenden Felder:
icon
gibt die URL für ein farbiges PNG-Symbol mit einer Größe von 71 × 71 px zurück (nur „Places“-Dienst).
iconBackgroundColor
und icon_background_color
geben den standardmäßigen Hex-Farbcode für die Kategorie des Ortssymbols zurück.
icon_mask_base_uri
(„Places“-Dienst) gibt die Basis-URL für ein nicht farbiges Symbol ohne die Dateityperweiterung (.svg
oder .png
) zurück.
svgIconMaskURI
(„Place“-Klasse) gibt die Basis-URL eines nicht farbigen SVG-Symbols zurück.
Ortssymbol und Farbe auf eine Markierung anwenden
Mit „Place Details“ können Sie ein Ortssymbol und eine Hintergrundfarbe anfordern, die sich auf Markierungen anwenden lassen. Das folgende Beispiel zeigt Code zum Erstellen einer Markierung mit Ortsdaten. Dabei wird place.iconBackgroundColor
an die Option PinElement.background
und place.svgIconMaskURI
an PinElement.glyph
übergeben. Verwenden Sie place.location
, um die Markierung an der richtigen Stelle zu platzieren. In diesem Beispiel wird auch place.displayName
im Titel der Markierung angezeigt.
TypeScript
// A marker customized using a place icon and color, name, and geometry.
const place = new Place({
id: 'ChIJN5Nz71W3j4ARhx5bwpTQEGg',
});
// Call fetchFields, passing the desired data fields.
await place.fetchFields({ fields: ['location', 'displayName', 'svgIconMaskURI', 'iconBackgroundColor'] });
const pinElement = new PinElement({
background: place.iconBackgroundColor,
glyph: new URL(String(place.svgIconMaskURI)),
});
const placeIconMarkerView = new AdvancedMarkerElement({
map,
position: place.location,
content: pinElement.element,
title: place.displayName,
});
JavaScript
// A marker customized using a place icon and color, name, and geometry.
const place = new Place({
id: "ChIJN5Nz71W3j4ARhx5bwpTQEGg",
});
// Call fetchFields, passing the desired data fields.
await place.fetchFields({
fields: [
"location",
"displayName",
"svgIconMaskURI",
"iconBackgroundColor",
],
});
const pinElement = new PinElement({
background: place.iconBackgroundColor,
glyph: new URL(String(place.svgIconMaskURI)),
});
const placeIconMarkerView = new AdvancedMarkerElement({
map,
position: place.location,
content: pinElement.element,
title: place.displayName,
});
Beispiel ansehen
Anfragen für Ortssymbole und Hintergrundfarben
In den folgenden Tabellen finden Sie alle verfügbaren Ortssymbole nach Kategorie. Standardmäßig werden sie mit einer schwarzen Glyphe angezeigt. Die Hintergrundfarbe des Symbols richtet sich nach der Kategorie des Orts.
Ortskategorie: Essen und Trinken (Symbolhintergrundfarbe #FF9E67) |

Bar, Nachtclub
|

Café
|

Restaurant, Bäckerei
|
Ortskategorie: Einzelhandel (Symbolhintergrundfarbe #4B96F3) |

Bücher, Kleidung, Elektronik, Schmuck, Schuhe, Einkaufszentrum
|

Minimarkt
|

Lebensmittelgeschäft, Supermarkt
|

Apotheke
|
Ortskategorie: Dienstleistungen (Symbolhintergrundfarbe #909CE1) |

Geldautomat
|

Bank
|

Tankstelle
|

Unterkunft
|

Postfiliale
|
Ortskategorie: Unterhaltung (Symbolhintergrundfarbe #13B5C7) |

Aquarium, touristisch
|

Golf
|

Historisch
|

Kino
|

Museum
|

Theater
|
Ortskategorie: Transport (Symbolhintergrundfarbe #10BDFF) |

Flughafen
|

Bus, Mitfahrdienst, Taxi
|

Züge/Bahnen
|
Ortskategorie: Gemeinde/allgemein/religiös (Symbolhintergrundfarbe #7B9EB0) |

Friedhof
|

Öffentliches Gebäude
|

Bibliothek
|

Denkmal
|

Parkplatz
|

Schule (Grundschule, Sekundarstufe, Universität)
|

Andachtsstätte (christlich)
|

Andachtsstätte (Hindu)
|

Andachtsstätte (Islam)
|

Andachtsstätte (Jainismus)
|

Andachtsstätte (jüdisch)
|

Andachtsstätte (Sikh)
|

Allgemeines Unternehmen
|
Ortskategorie: Outdoor (Symbolhintergrundfarbe #4DB546) |

Bootsfahrten
|

Camping
|

Park
|

Stadion
|

Zoo
|
Ortskategorie: Notfall (Symbolhintergrundfarbe #F88181) |

Krankenhaus
|

Polizei
|
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-31 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-08-31 (UTC)."],[[["\u003cp\u003ePlace icons, accessible through the Place Class or Places Service, visually represent various place types like restaurants and libraries.\u003c/p\u003e\n"],["\u003cp\u003eYou can customize markers by using a place's icon, background color, name, and location data.\u003c/p\u003e\n"],["\u003cp\u003ePlace icons are categorized and have default background colors based on their category (e.g., food and drink places have an orange background).\u003c/p\u003e\n"],["\u003cp\u003eThe documentation provides code samples in TypeScript and JavaScript for applying place icons and colors to markers.\u003c/p\u003e\n"],["\u003cp\u003eYou can find a comprehensive table showcasing all available place icons and their corresponding background colors within the documentation.\u003c/p\u003e\n"]]],["Place icons represent various types of locations. Using the Place Class or Places Service, you can retrieve `icon` (a colored PNG), `iconBackgroundColor` (HEX code), and `icon_mask_base_uri` (base URL for a non-colored icon). Apply these to markers: utilize `iconBackgroundColor` for the PinElement's background and `svgIconMaskURI` for its glyph, while positioning the marker with `place.location`. A provided example shows TypeScript and JavaScript code to implement this, fetching fields to customize a marker with place icon and colors.\n"],null,["Select platform: [Android](/maps/documentation/places/android-sdk/icons \"View this page for the Android platform docs.\") [iOS](/maps/documentation/places/ios-sdk/icons \"View this page for the iOS platform docs.\") [JavaScript](/maps/documentation/javascript/place-icons \"View this page for the JavaScript platform docs.\") [Web Service](/maps/documentation/places/web-service/icons \"View this page for the Web Service platform docs.\")\n\nPlace icons indicate the various types of places (for example coffee shops, libraries, and\nmuseums). You can request icons and their background colors using the\n[Place Class](/maps/documentation/javascript/place).\n\nFields\n\nUse the following fields to work with place icons:\n\n| **Field** | **Place Class** | **Places Service** |\n|-----------------------|-------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------|\n| Icon | --- | [icon](/maps/documentation/javascript/reference/places-service#PlaceResult.) |\n| Icon background color | [iconBackgroundColor](/maps/documentation/javascript/reference/place#Place.iconBackgroundColor) | [icon_background_color](/maps/documentation/javascript/reference/places-service#PlaceResult.icon_background_color) |\n| Icon mask URI | [svgIconMaskURI](/maps/documentation/javascript/reference/place#Place.svgIconMaskURI) | [icon_mask_base_uri](/maps/documentation/javascript/reference/places-service#PlaceResult.icon_mask_base_uri) |\n\n- `icon` returns the URL for a colored 71px x 71px PNG icon (Places Service only).\n- `iconBackgroundColor` and `icon_background_color` return the default HEX color code for the place icon's category.\n- `icon_mask_base_uri` (Places Service) returns the base URL for a non-colored icon, minus the file type extension (append `.svg` or `.png`).\n- `svgIconMaskURI` (Place Class) returns the base URL for a non-colored SVG icon.\n\nApply place icon and color to a marker\n\nWith Place Details, you can request a place icon and background color which you can apply\nto markers. The following example shows code to create a marker using place data by passing\n`place.iconBackgroundColor` to the `PinElement.background` option, and\n`place.svgIconMaskURI` to `PinElement.glyph`. Use `place.location`\nto place the marker in the correct location. This example also displays the `place.displayName`\nin the marker title. \n\nTypeScript \n\n```typescript\n// A marker customized using a place icon and color, name, and geometry.\nconst place = new Place({\n id: 'ChIJN5Nz71W3j4ARhx5bwpTQEGg',\n});\n\n// Call fetchFields, passing the desired data fields.\nawait place.fetchFields({ fields: ['location', 'displayName', 'svgIconMaskURI', 'iconBackgroundColor'] });\n\nconst pinElement = new PinElement({\n background: place.iconBackgroundColor,\n glyph: new URL(String(place.svgIconMaskURI)),\n});\n\nconst placeIconMarkerView = new AdvancedMarkerElement({\n map,\n position: place.location,\n content: pinElement.element,\n title: place.displayName,\n});https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/samples/advanced-markers-graphics/index.ts#L68-L87\n```\n| **Note:** Read the [guide](/maps/documentation/javascript/using-typescript) on using TypeScript and Google Maps.\n\nJavaScript \n\n```javascript\n// A marker customized using a place icon and color, name, and geometry.\nconst place = new Place({\n id: \"ChIJN5Nz71W3j4ARhx5bwpTQEGg\",\n});\n\n// Call fetchFields, passing the desired data fields.\nawait place.fetchFields({\n fields: [\n \"location\",\n \"displayName\",\n \"svgIconMaskURI\",\n \"iconBackgroundColor\",\n ],\n});\n\nconst pinElement = new PinElement({\n background: place.iconBackgroundColor,\n glyph: new URL(String(place.svgIconMaskURI)),\n});\nconst placeIconMarkerView = new AdvancedMarkerElement({\n map,\n position: place.location,\n content: pinElement.element,\n title: place.displayName,\n});https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/dist/samples/advanced-markers-graphics/docs/index.js#L67-L91\n```\n[See the example](/maps/documentation/javascript/examples/advanced-markers-graphics)\n\nPlace icon and background color requests\n\nThe following tables show all of the available place icons by category. By\ndefault these display with a black glyph. The icon background color\nis dictated by the place's category.\n\n| **Place category: Food and drink** (icon background color #FF9E67) ||||\n|--------------------------------------------------------------------|-----------------------------------------|----------------------|------------------|\n| Bar, Night club | Cafe | Restaurant, Bakery |\n| Books, Clothing, Electronics, Jewelry, Shoes, Shopping center/Mall | Convenience store | Grocery, Supermarket | Pharmacy |\n| ATM | Bank | Gas | Lodging |\n| Post office |\n| Aquarium, Tourist | Golf | Historic | Movie |\n| Museum | Theater |\n| Airport | Bus, rideshare, taxi | Train/Rail |\n| Cemetery | Civic building | Library | Monument |\n| Parking | School (primary, secondary, university) | Worship (Christian) |\n| Worship (Hindu) | Worship (Islam) | Worship (Jain) | Worship (Jewish) |\n| Worship (Sikh) | Generic business |\n| Boating | Camping | Park | Stadium |\n| Zoo |\n| Hospital | Police |"]]