How to find coordinates for overlaying Google Maps?

I'm trying to get started with the Google Maps API, but I find the documentation incredibly confusing. Does anyone know how to find the image coordinates for a ground overlay?

I copied the code here (https://developers.google.com/maps/documentation/javascript/overlays#GroundOverlays) and asked him to work on my site with my image. But when I try to change the coordinates from Newark to my location, the image does not appear at all. I just estimated the coordinates for imageBounds, and I guess that makes it not work. Any help would be most appreciated.

This is my code (LatLng coordinates are copied from the example):

      function initialize() {

  var newark = new google.maps.LatLng(40.740, -74.18);
  var imageBounds = new google.maps.LatLngBounds(
      new google.maps.LatLng(40.712216,-74.22655),
      new google.maps.LatLng(40.773941,-74.12544));

  var myOptions = {
    zoom: 13,
    center: newark,
    mapTypeId: google.maps.MapTypeId.ROADMAP
  }

  var map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);

  var oldmap = new google.maps.GroundOverlay(
      "http://www.mcography.com/beta/Accessibility_Map.png",
      imageBounds);
  oldmap.setMap(map);
}
+3
source share
1 answer

LatLng Marker LatLng maps.google.com labs ( ). , LatLng.

, LatLngBounds. - ( ), - ( ). , .

+2

All Articles