Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6369769
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T00:50:47+00:00 2026-05-25T00:50:47+00:00

Im try to get the markers coordinates to the map, or to the window,

  • 0

Im try to get the markers coordinates to the map, or to the window, to set a special functions when i make over with the mouse, my test code is this:

        var multiMarker = [];
    var xmyOptions = { // Ponemos unas coordenadas iniciales al mapa de google maps.
      zoom: 16, 
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var xmap = new google.maps.Map($('#map_canvas2').get(0), xmyOptions); // Iniciamos el mapa indicando el Div donde se va a cargar y las opciones.

    for (x=0; x<9; x++) {

        multiMarker[x] = new google.maps.Marker({ // Definimos una nueva "marca" o puntero
            position: new google.maps.LatLng('40.' + Math.floor(Math.random()*99999999), '-3.' + Math.floor(Math.random()*99999999)),
            draggable: true,
            map: xmap,
            title: 'Ejemplo marcador arrastrable'
        });

        google.maps.event.addListener(multiMarker[x], 'mouseover', function(){
            console.log(this);
        });

    }

    var bounds = new google.maps.LatLngBounds();  
    for (index in multiMarker) {  
        var data = multiMarker[index];  
        bounds.extend(new google.maps.LatLng(data.position.Oa, data.position.Pa));  
    }  
    xmap.fitBounds(bounds); 

The problem is i cant get this coordinates in the marker[x] object, i only see the latitude and longitude, and I need the top, left, bottom or right position of the marker to set special floating tooltips. The API doesnt have this info?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T00:50:48+00:00Added an answer on May 25, 2026 at 12:50 am

    I answered similar question here: How to access Google Maps API v3 marker's DIV and its pixel position?

    What you can get is position of marker in world coordinate, then convert to offset from top left corner of visible rectangle. But it’s only position, you don’t have access to marker itself, so you can’t add events to it or alter marker div this way.

    var scale = Math.pow(2, map.getZoom());
    var nw = new google.maps.LatLng(
        map.getBounds().getNorthEast().lat(),
        map.getBounds().getSouthWest().lng()
    );
    var worldCoordinateNW = map.getProjection().fromLatLngToPoint(nw);
    var worldCoordinate = map.getProjection().fromLatLngToPoint(marker.getPosition());
    var pixelOffset = new google.maps.Point(
        Math.floor((worldCoordinate.x - worldCoordinateNW.x) * scale),
        Math.floor((worldCoordinate.y - worldCoordinateNW.y) * scale)
    );
    

    If for some reason you need access to marker’s div, then you need to check what divs are created for map, select in which layer (markers are in one layer, but I don’t remember which, don’t confuse them with marker shadows :-)) and then somehow check which position this divs have, to select one you need.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I try to get all WPF window controls collections. In other words i try
I try to get this following url using the downloadURL function as follows: http://www.ncbi.nlm.nih.gov/nuccore/27884304
I have this snippet of code (AJAX) in jQuery. $.get('someScript.php?lat=' + clickedLatLng.lat() + '&lon='
This is used to get a list of previously served markers from session: session_start();
I try get the mp3 flash player to work with my javascript on all
I try to get to a page straight from Bash at http://www.ocwconsortium.org/ . The
I try to get the name of executable name of all of my launched
I try to get the last modification date of a file: NSFileManager *fm =
When I try to get the eventinfo of a WPF 'rectangle', if the routedEvent
I face a problem when I try to get value from primary table in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.