Restez organisé à l'aide des collections
Enregistrez et classez les contenus selon vos préférences.
Cette page liste les problèmes connus et les solutions de contournement pour les cartes vectorielles et les éléments cartographiques WebGL.
Compatibilité avec les navigateurs et appareils
L'aperçu des fonctionnalités WebGL est compatible avec les mêmes navigateurs et appareils que l'API Maps JavaScript.
Pour vérifier si le navigateur d'un appareil est compatible avec WebGL, consultez get.webgl.org ou caniuse.com. Vérifiez également que l'accélération matérielle est activée dans les paramètres du navigateur, sans quoi une carte matricielle s'affichera à la place de la carte vectorielle.
Carte matricielle et carte vectorielle
Parfois, une carte matricielle peut s'afficher à la place d'une carte vectorielle. Dans ce cas, les éléments cartographiques dépendant de la carte vectorielle ne sont pas disponibles. L'affichage d'une carte matricielle peut se produire pour diverses raisons. Cette section vous explique comment configurer correctement votre navigateur Web et vérifier de manière programmatique si les cartes vectorielles sont fonctionnelles.
Vérifier les fonctionnalités du navigateur Chrome
Pour déterminer quelles fonctionnalités d'accélération matérielle sont activées dans une installation spécifique de Chrome, accédez à chrome://gpu/ et assurez-vous que les éléments suivants sont activés (en vert) :
"OpenGL : activé"
"WebGL : accélération matérielle"
"WebGL2 : accélération matérielle"
Il s'agit d'exigences de base. Toutefois, la compatibilité peut être affectée par d'autres facteurs. Consultez "Bugs connus" ci-dessous.
Activer l'accélération matérielle
Pour que les cartes vectorielles soient compatibles, l'accélération matérielle doit être activée dans la plupart des navigateurs. Pour activer l'accélération matérielle dans Chrome et Microsoft Edge, accédez aux paramètres, sélectionnez Système et assurez-vous que l'option Utiliser l'accélération matérielle si disponible est activée.
Vérification programmatique des cartes matricielles et vectorielles
Vous pouvez vérifier si une carte est matricielle ou vectorielle de manière programmatique, en appelant map.getRenderingType(). L'exemple de code ci-dessous permet de surveiller l'événement renderingtype_changed et d'afficher une fenêtre d'informations indiquant si une carte matricielle ou vectorielle est utilisée.
TypeScript
/** * This example creates a map with an info window that shows whether * the map render type is raster or vector. */functioninitMap(){constcenter={lat:0,lng:0};constmap=newgoogle.maps.Map(document.getElementById('map')asHTMLElement,{center,zoom:10,heading:0.0,tilt:0.0,// Map ID for a vector map.mapId:'6ff586e93e18149f',});constcanvas=document.createElement("canvas");constinfoWindow=newgoogle.maps.InfoWindow({content:'',ariaLabel:'Raster/Vector',position:center,});infoWindow.open({map,});map.addListener('renderingtype_changed',()=>{infoWindow.setContent(`${map.getRenderingType()}`);});}declareglobal{interfaceWindow{initMap:()=>void;}}window.initMap=initMap;
/** * This example creates a map with an info window that shows whether * the map render type is raster or vector. */functioninitMap(){constcenter={lat:0,lng:0};constmap=newgoogle.maps.Map(document.getElementById("map"),{center,zoom:10,heading:0.0,tilt:0.0,// Map ID for a vector map.mapId:"6ff586e93e18149f",});constcanvas=document.createElement("canvas");constinfoWindow=newgoogle.maps.InfoWindow({content:"",ariaLabel:"Raster/Vector",position:center,});infoWindow.open({map,});map.addListener("renderingtype_changed",()=>{infoWindow.setContent(`${map.getRenderingType()}`);});}window.initMap=initMap;
La compatibilité des cartes vectorielles avec le Web mobile est encore au stade expérimental. Les développeurs peuvent utiliser des API clientes pour détecter les navigateurs Web mobiles et utiliser un ID de carte associé à une carte matricielle plutôt qu'à une carte vectorielle. Nous estimons que l'affichage sera plus lent sur certains appareils mobiles. Si vous choisissez d'utiliser des cartes vectorielles sur le Web mobile, n'hésitez pas à nous faire part de vos commentaires et de vos statistiques sur les performances. Comme indiqué ci-dessus, l'ID de carte vectorielle basculera automatiquement vers une carte matricielle en cas d'incompatibilité.
Bugs
Bugs connus
Il existe un problème connu dans Chrome sur certains appareils macOS équipés de GPU AMD. Ce problème peut particulièrement prêter à confusion lorsque macOS bascule d'un GPU à l'autre sur les appareils qui en ont plusieurs. Par conséquent, les cartes vectorielles ne seront peut-être pas disponibles si d'autres applications sont en cours d'exécution, ou si un écran externe est branché.
Dans certains cas, activer le backend ANGLE Metal, bientôt disponible, semble résoudre le problème. Suivez les plans de déploiement généraux à l'adresse
https://bugs.chromium.org/p/chromium/issues/detail?id=1322521.
Signaler des bugs
Veuillez installer les dernières mises à jour du navigateur et du pilote du GPU avant de signaler le bug.
Vérifiez que le paramètre d'accélération matérielle chrome://settings/system (Chrome), about:preferences#general (Firefox) ou edge://settings/system (Microsoft Edge) est activé. Dans Safari, ce paramètre est activé automatiquement dans macOS 10.15 ou version ultérieure. Pour les versions antérieures de MacOS, accédez aux paramètres avancés de Safari et vérifiez que l'option "Utiliser l'accélération matérielle" est activée.
Incluez un lien vers l'exemple de code jsfiddle dans le rapport de bug.
Veuillez également prendre une capture d'écran de chrome://gpu (Chrome), de about:support (Firefox) ou de edge://gpu (Microsoft Edge), ou joindre des informations du GPU dans le rapport de bug si vous rencontrez des problèmes d'affichage.
Donnez-nous votre avis !
Vos commentaires nous sont très utiles, car ils nous permettent de proposer la meilleure expérience de cartographie vectorielle possible pour vous et vos utilisateurs finaux. Contactez-nous si :
vous détectez de nouvelles erreurs JavaScript, ou de nouveaux bugs ou plantages, dans vos applications Web ;
la latence de démarrage pour les cartes vectorielles est nettement supérieure à celle des cartes matricielles (dans ce cas, les métriques de régression de la latence du démarrage sont très utiles. En général, nous souhaitons savoir si la latence au démarrage dépasse le seuil acceptable) ;
l'expérience des cartes vectorielles n'est pas aussi fluide qu'elle pourrait l'être (si vous consignez des métriques concernant les FPS ou les à-coups, comparez celles des cartes vectorielles à celles des cartes matricielles) ;
les performances varient considérablement d'un navigateur à l'autre.
Si vous avez configuré des tests A/B pour comparer les cartes vectorielles et les cartes matricielles, veuillez nous envoyer vos commentaires sur les performances. Ils nous aideront à améliorer le produit.
Sauf indication contraire, le contenu de cette page est régi par une licence Creative Commons Attribution 4.0, et les échantillons de code sont régis par une licence Apache 2.0. Pour en savoir plus, consultez les Règles du site Google Developers. Java est une marque déposée d'Oracle et/ou de ses sociétés affiliées.
Dernière mise à jour le 2025/09/05 (UTC).
[[["Facile à comprendre","easyToUnderstand","thumb-up"],["J'ai pu résoudre mon problème","solvedMyProblem","thumb-up"],["Autre","otherUp","thumb-up"]],[["Il n'y a pas l'information dont j'ai besoin","missingTheInformationINeed","thumb-down"],["Trop compliqué/Trop d'étapes","tooComplicatedTooManySteps","thumb-down"],["Obsolète","outOfDate","thumb-down"],["Problème de traduction","translationIssue","thumb-down"],["Mauvais exemple/Erreur de code","samplesCodeIssue","thumb-down"],["Autre","otherDown","thumb-down"]],["Dernière mise à jour le 2025/09/05 (UTC)."],[[["\u003cp\u003eThis page addresses known issues and workarounds for vector maps and WebGL features in Google Maps.\u003c/p\u003e\n"],["\u003cp\u003eHardware acceleration must be enabled in your browser settings for vector maps to function correctly; instructions for various browsers are provided.\u003c/p\u003e\n"],["\u003cp\u003eYou can programmatically determine if a map is rendering in vector or raster mode using the \u003ccode\u003emap.getRenderingType()\u003c/code\u003e method.\u003c/p\u003e\n"],["\u003cp\u003eThere are known issues with vector maps on certain macOS devices with AMD GPUs in Chrome, potentially due to dynamic GPU switching.\u003c/p\u003e\n"],["\u003cp\u003eFeedback on performance, bugs, and user experience with vector maps is encouraged to help improve the feature.\u003c/p\u003e\n"]]],["This document details vector map and WebGL feature support, troubleshooting, and usage. Key actions include: checking browser support via `get.webgl.org` or `caniuse.com`; enabling hardware acceleration in browser settings; using `chrome://gpu/` to verify hardware acceleration in Chrome; and programmatically checking for raster or vector maps using `map.getRenderingType()`. The document also covers mobile web support limitations, known bugs, and how to report them, including updating browsers/drivers and providing relevant diagnostic information.\n"],null,["# Support\n\nThis page lists known issues and workarounds for vector maps and WebGL features.\n\nBrowser/device support\n----------------------\n\nThe WebGL feature preview supports the same browsers and devices as the Maps JavaScript API.\nTo check whether the browser on a particular device will support WebGL, visit [get.webgl.org](https://get.webgl.org/)\nor [caniuse.com](https://caniuse.com/?search=webgl). Please also ensure the\nhardware acceleration is enabled in the browser settings, otherwise vector maps\nwill revert to [raster](#raster-fallback).\n\nRaster or vector?\n-----------------\n\nOccasionally, a vector map may fall back to raster. When this happens, features\ndepending on the vector map are unavailable. Fallback to a raster map may occur\nfor a variety of reasons. This section shows you how to correctly configure\nyour web browser, and how to programmatically check whether vector map\ncapability is present.\n\n### Check browser capabilities on Chrome\n\nTo determine which hardware acceleration capabilities are enabled in a specific\ninstallation of Chrome, navigate to \u003cchrome://gpu/\u003e, and ensure\nthat the following items are enabled (in green):\n\n- \"OpenGL: Enabled\"\n- \"WebGL: Hardware accelerated\"\n- \"WebGL2: Hardware accelerated\"\n\n(These are just baseline requirements, there can be other factors which\nimpact support, see \"Known bugs\" below.)\n\n### Enable hardware acceleration\n\nIn order to support vector maps, hardware acceleration must be enabled in most\nbrowsers. To enable hardware acceleration in Chrome and Microsoft Edge, open\n**Settings** , select **System** , and ensure that **Use hardware acceleration\nwhen available** is enabled.\n\n- Learn how to [change websites preferences in Safari](https://support.apple.com/guide/safari/websites-ibrwe2159f50/14.0/mac/11.0).\n- Learn about [Firefox's performance settings](https://support.mozilla.org/en-US/kb/performance-settings).\n\n### Programmatically check for raster or vector\n\nYou can programmatically check to see whether a map is raster or vector, by\ncalling `map.getRenderingType()`. The following example shows code to monitor\nthe `renderingtype_changed` event, and show an info window displaying whether a\nraster or vector map is in use.\n\n\n### TypeScript\n\n```typescript\n/**\n * This example creates a map with an info window that shows whether\n * the map render type is raster or vector.\n */\n\n function initMap() {\n const center = {lat: 0, lng: 0};\n const map = new google.maps.Map(document.getElementById('map') as HTMLElement, {\n center,\n zoom: 10,\n heading: 0.0,\n tilt: 0.0,\n // Map ID for a vector map.\n mapId: '6ff586e93e18149f',\n });\n const canvas = document.createElement(\"canvas\");\n const infoWindow = new google.maps.InfoWindow({\n content: '',\n ariaLabel: 'Raster/Vector',\n position: center,\n });\n infoWindow.open({\n map,\n });\n\n map.addListener('renderingtype_changed', () =\u003e {\n infoWindow.setContent(`${map.getRenderingType()}`);\n });\n }\n\n declare global {\n interface Window {\n initMap: () =\u003e void;\n }\n }\n window.initMap = initMap;https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/samples/vector-detector/index.ts#L8-L43\n```\n| **Note:** Read the [guide](/maps/documentation/javascript/using-typescript) on using TypeScript and Google Maps.\n\n### JavaScript\n\n```javascript\n/**\n * This example creates a map with an info window that shows whether\n * the map render type is raster or vector.\n */\nfunction initMap() {\n const center = { lat: 0, lng: 0 };\n const map = new google.maps.Map(document.getElementById(\"map\"), {\n center,\n zoom: 10,\n heading: 0.0,\n tilt: 0.0,\n // Map ID for a vector map.\n mapId: \"6ff586e93e18149f\",\n });\n const canvas = document.createElement(\"canvas\");\n const infoWindow = new google.maps.InfoWindow({\n content: \"\",\n ariaLabel: \"Raster/Vector\",\n position: center,\n });\n\n infoWindow.open({\n map,\n });\n map.addListener(\"renderingtype_changed\", () =\u003e {\n infoWindow.setContent(`${map.getRenderingType()}`);\n });\n}\n\nwindow.initMap = initMap;https://github.com/googlemaps/js-samples/blob/2683f7366fb27829401945d2a7e27d77ed2df8e5/dist/samples/vector-detector/docs/index.js#L7-L36\n```\n\n\u003cbr /\u003e\n\nYou can also use the WebGL rendering context to check support for WebGL 2: \n\n const canvas = document.createElement(\"canvas\");\n canvas.getContext(\"webgl2\") ? console.log(\"WebGL 2 is supported\") : console.log(\"WebGL 2 is NOT supported\");\n\nLearn other ways to [programmatically detect WebGL rendering context](https://developer.mozilla.org/en-US/docs/Web/API/WebGL_API/By_example/Detect_WebGL).\n\nMobile web support\n------------------\n\nMobile web support for vector maps is still experimental. Developers can use\nclient APIs to detect mobile web browsers and use a map ID associated with a\nraster map instead of a vector map. We anticipate slower rendering performance\nfor some mobile devices. If you choose to use vector maps on mobile web, we\nwould greatly appreciate performance statistics and feedback. As above, if\nVector Maps support is not available, a vector map ID will automatically\nfallback to using a raster map.\n\nBugs\n----\n\n### Known bugs\n\n- There is a known issue in Chrome on some macOS devices with AMD GPUs. This can be particularly confusing when macOS dynamically switches between GPUs on devices with multiple GPUs, so vector maps may not be available depending on what other apps are running, or whether an external monitor is connected. Turning on Chrome's upcoming ANGLE Metal backend appears to fix this issue in some cases. You can follow general rollout plans for this at \u003chttps://bugs.chromium.org/p/chromium/issues/detail?id=1322521\u003e.\n\n### Reporting bugs\n\n- Please update the browser and GPU driver to the latest version before reporting the bug.\n- Ensure that the hardware acceleration setting at `chrome://settings/system` (Chrome), `about:preferences#general` (Firefox), `edge://settings/system` (Microsoft Edge) is enabled. In Safari, this setting is enabled automatically in macOS version 10.15 or newer. For older MacOS version(s), please go to the Safari advanced settings and ensure that the \"Use hardware acceleration\" option is enabled.\n- Include [jsfiddle](https://jsfiddle.net/L320szg9/) sample code link in the bug report.\n- Please also take a screenshot of `chrome://gpu` (Chrome), `about:support` (Firefox) or `edge://gpu` (Microsoft Edge), attach GPU related info in bug report if you encounter any rendering issues.\n\nTell us what you think!\n-----------------------\n\nWe value your feedback as we strive to make the best vector map experience for\nyou and your end-users. Please let us know if:\n\n- There are any new JavaScript errors or bugs/crashes that you detect in your web apps.\n- Startup latency for vector maps is significantly worse than that for raster maps. If this is the case, metrics for startup latency regression are very helpful. In general, we want to know if startup latency regresses beyond acceptable thresholds.\n- The vector maps experience is not as smooth as it could be. If you log FPS or jank metrics, how do they compare between vector and raster maps?\n- Performance differs greatly by browser.\n\nIf you have set up A/B testing for a comparison of vector maps vs. raster maps,\nplease share any performance feedback you acquire, as this will be very useful\nto help us refine the feature."]]