Stay organized with collections Save and categorize content based on your preferences.
This example displays a customized popup on the map. Alternatively, use a Marker or Info Window to display the default popups.
Read the documentation.
Clone SampleGit and Node.js are required to run this sample locally. Follow these instructions to install Node.js and NPM. The following commands clone, install dependencies and start the sample application.
git clone -b sample-overlay-popup https://github.com/googlemaps/js-samples.git
cd js-samples
npm i
npm start
Other samples can be tried by switching to any branch beginning with sample-SAMPLE_NAME
.
git checkout sample-SAMPLE_NAME
npm i
npm start
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.
Last updated 2025-07-09 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-07-09 UTC."],[[["This example demonstrates how to create and display custom popups on a Google Map using the Maps JavaScript API."],["It provides code samples in TypeScript and JavaScript, along with CSS and HTML for styling and structure."],["Developers can customize the content and appearance of the popup, and control its positioning on the map."],["The example utilizes the `google.maps.OverlayView` class to create the custom overlay and manage its interactions with the map."],["As an alternative to custom popups, the standard Marker and Info Window components can be used for default popup behavior."]]],["This content demonstrates creating a custom popup on a Google Map. It initializes a map and defines a `Popup` class, extending `google.maps.OverlayView`. This class constructs a popup with content, positions it, and manages its visibility based on map view. The `initMap` function creates the map and sets up the custom popup with specific content and location. CSS styles the popup, bubble, and container elements. It also provides instructions to run the example and a jsfiddle.net link.\n"]]
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4