Führen Sie diese Schritte aus, um erweiterte Markierungen einzurichten.
API-Schlüssel anfordern und Maps JavaScript API aktivieren
Damit Sie erweiterte Markierungen verwenden können, benötigen Sie ein Cloud-Projekt mit einem Rechnungskonto. Außerdem muss die Maps JavaScript API aktiviert sein. Weitere Informationen finden Sie unter Google Cloud-Projekt einrichten.
Geben Sie eine Karten-ID an, wenn Sie die Karte mit der Eigenschaft mapId instanziieren.
Sie können selbst eine Karten-ID angeben oder DEMO_MAP_ID verwenden.
Für erweiterte Markierungen ist eine Karten-ID erforderlich. Wenn die Karten-ID fehlt, können keine erweiterten Markierungen geladen werden. Zur Fehlerbehebung können Sie einen mapcapabilities_changed-Listener hinzufügen, um über Änderungen der Kartenfunktionen informiert zu werden. Die Verwendung von „mapCapabilities“ ist optional und wird nur für Test- und Fehlerbehebungszwecke oder für das Laufzeit-Fallback empfohlen.
// Optional: subscribe to map capability changes.map.addListener('mapcapabilities_changed',()=>{constmapCapabilities=map.getMapCapabilities();if(!mapCapabilities.isAdvancedMarkersAvailable){// Advanced markers are *not* available, add a fallback.}});
[[["Leicht verständlich","easyToUnderstand","thumb-up"],["Mein Problem wurde gelöst","solvedMyProblem","thumb-up"],["Sonstiges","otherUp","thumb-up"]],[["Benötigte Informationen nicht gefunden","missingTheInformationINeed","thumb-down"],["Zu umständlich/zu viele Schritte","tooComplicatedTooManySteps","thumb-down"],["Nicht mehr aktuell","outOfDate","thumb-down"],["Problem mit der Übersetzung","translationIssue","thumb-down"],["Problem mit Beispielen/Code","samplesCodeIssue","thumb-down"],["Sonstiges","otherDown","thumb-down"]],["Zuletzt aktualisiert: 2025-05-13 (UTC)."],[[["Get started with advanced markers by obtaining an API key, enabling the Maps JavaScript API, and creating a map ID."],["Update your map initialization code to include loading the advanced markers library and providing a map ID when instantiating the map."],["For testing purposes, use `DEMO_MAP_ID` as the map ID or utilize the provided example code, but replace the example map IDs for production."],["Optionally, check map capabilities to ensure advanced markers are available or to implement a fallback if they are not supported."]]],["To use advanced markers, you need a Cloud project with a billing account and the Maps JavaScript API enabled. First, obtain an API key and create a map ID, selecting JavaScript as the map type with either Vector or Raster options, or using `DEMO_MAP_ID` for testing. Update your map initialization code by loading the Maps JavaScript API and the advanced markers library. Instantiate the map with the created or demo map ID. Optionally, use a listener to check map capabilities.\n"]]