title: Is there some simple way to get map.fromLatLngToDivPixel in API V3?
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/1538681/how-to-call-fromlatlngtodivpixel-in-google-maps-api-v3">How to call fromLatLngToDivPixel in Google Maps API V3?</a>  </p>
  </blockquote>
  
  
  
  <pre><code>aPoint=map.fromLatLngToDivPixel(labelA.getPoint());
  bPoint=map.fromLatLngToDivPixel(labelB.getPoint()); 
  </code></pre>
  
  <p>I've tried the Overlay approach, but failed, as I need to get the variables back to the function:</p>
  
  <pre><code>function LabelLatLongSort(a,b)
  {
      labelA = eval("label_"+a.deviceId);
      labelB = eval("label_"+b.deviceId);
      longOffset = eval("offsetOverlapWith_"+a.customId);
      overlay = new google.maps.OverlayView();
      overlay.draw = function() {};
      overlay.setMap(map);
      google.maps.event.addListenerOnce(map, 'idle', function() {
       aPoint=overlay.getProjection().fromLatLngToDivPixel(labelA.getPoint()); 
       bPoint=overlay.getProjection().fromLatLngToDivPixel(labelB.getPoint());
      });             
       diffLat = bPoint.y-aPoint.y;
       diffLong = aPoint.x-bPoint.x; 
      if (Math.abs(diffLong)&gt;longOffset) return diffLong;
      if (diffLat==0)
      {
          return b.deviceId-a.deviceId;
      }
      return diffLat;
  }
  </code></pre>