Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

180
Views
Mover el centro de Google Maps y la ubicación del marcador sin actualizar

¿Hay alguna manera de mover un marker o volver a recenter el map sin volver a redrawing todo el map ?

estoy usando este codigo

 var markerLat = 39.0 var markerLon = -80.0; var centerLat = 39.0; var centerLon = -80.0 var myZoom = 15; function initMap() { // The location of Uluru const uluru = { lat: centerLat, lng: centerLon }; // The map, centered at Uluru const map = new google.maps.Map(document.getElementById("map"), { zoom: myZoom, center: uluru, }); // The marker, positioned at Uluru var myLatlng = new google.maps.LatLng(markerLat,markerLon); const marker = new google.maps.Marker({ position: myLatlng, map: map, }); } window.initMap = initMap; let eventSource = new EventSource("/sseTest"); eventSource.onmessage = function(event) { console.log("new message from index.js " + event.data); const myArray = event.data.split(" "); if(myArray[0] == 0) { markerLat = myArray[0]; markerLon = myArray[1]; } else { markerLat = myArray[2]; markerLon = myArray[3]; } const myMarkerLatlng = new google.maps.LatLng(markerLat, markerLon); const myCenterLatLon = new google.maps.LatLng(markerLat, markerLon); var mapOptions = { zoom: myZoom, center: myCenterLatLon, } var map = new google.maps.Map(document.getElementById("map"), mapOptions); var marker = new google.maps.Marker({ position: myMarkerLatlng, map: map, }); marker.setMap(map); };

y parece volver a redraw el map como una actualización de página completa cuando llega una actualización (una vez por minuto). Me gustaría simplemente mover el marker como lo hace cuando un usuario comparte su location contigo.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!