Bug: event-click-latlng
@wangela ya está trabajando en esto.
Desde el 26/8/2022.
Evaluación
Este issue todavía no se ha evaluado.
Descripción
Operating system
ubuntu 22.04
Browser Version
Chrome 104.0.5112.101 (oficial) 64 bits
How severe is the bug?
moderate
Bug description
function initMap() {
const myLatlng = { lat: -25.363, lng: 131.044 };
const map = new google.maps.Map(document.getElementById("map")!, {
zoom: 4,
center: myLatlng,
});
// Create the initial InfoWindow.
let infoWindow = new google.maps.InfoWindow({
content: "Click the map to get Lat/Lng!",
position: myLatlng,
});
infoWindow.open(map);
// Configure the click listener.
map.addListener("click", (mapsMouseEvent) => {
// Close the current InfoWindow.
infoWindow.close();
// Create a new InfoWindow.
infoWindow = new google.maps.InfoWindow({
position: mapsMouseEvent.latLng,
});
infoWindow.setContent(
JSON.stringify(mapsMouseEvent.latLng.toJSON(), null, 2)
);
infoWindow.open(map);
});
}
declare global {
interface Window {
initMap: () => void;
}
}
window.initMap = initMap;
export {};
Steps to reproduce
Just run.
Console log output
I fixed it by commenting some parts below
<script>
function initMap() {
const myLatlng = { lat: -25.363, lng: 131.044 };
const map = new google.maps.Map(document.getElementById('map'), {
zoom: 4,
center: myLatlng,
});
// Create the initial InfoWindow.
let infoWindow = new google.maps.InfoWindow({
content: "Click the map to get Lat/Lng!",
position: myLatlng,
});
infoWindow.open(map);
// Configure the click listener.
map.addListener("click", (mapsMouseEvent) => {
// Close the current InfoWindow.
infoWindow.close();
// Create a new InfoWindow.
infoWindow = new google.maps.InfoWindow({
position: mapsMouseEvent.latLng,
});
infoWindow.setContent(
JSON.stringify(mapsMouseEvent.latLng.toJSON(), null, 2)
);
infoWindow.open(map);
});
}
/*
declare global {
interface Window {
initMap: () => void;
}
}*/
window.initMap = initMap;
//export {};
</script>
- Lenguaje dominante
- TypeScript
- Estrellas
- 804
- Forks
- 826
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de googlemaps/js-samples
-
Advanced Markers Animation Unused VariablePosiblemente ocupada @treckstar la tomó hace 832 días. Abierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 68/100
googlemaps/js-samples#1794 ·
-
DriverAbierto
Dificultad 5/5 Más de una semana Aptitud para principiantes 5/100
googlemaps/js-samples#1940 ·
-
Exposed api key in documentationAbierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 35/100
googlemaps/js-samples#1932 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 32/100
googlemaps/js-samples#1914 ·
-
Dificultad 4/5 3-5 días Aptitud para principiantes 25/100
googlemaps/js-samples#1827 · 1 comentario ·
Todos los issues de googlemaps/js-samples
Issues similares
-
pending close triaging
Dificultad 1/5 1-3 horas Aptitud para principiantes 74/100
anomalyco/opencode#63090 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
ai-driven-qa bug claude Cosmetic
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día
-
ai-driven-qa bug claude Minor
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
linagora/twake-mail-admin#609 ·
Los mantenedores suelen responder en 1 día