我正在网页上使用Google地图。当我加载页面时,我在浏览器控制台上看到了这个:
GET http://tile.openstreetmap.org/0/1/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/-1/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/2/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/-3/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/-2/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/-4/0.png 404 (Not Found)
GET http://tile.openstreetmap.org/0/3/0.png 404 (Not Found)
我试图调试这个,当调试器到达GetTileUrl方法时,coord数组有时带有X / Y的负值,所以,这就是它产生错误URL的原因。
有什么办法可以避免这个问题吗?我正在使用地图初始化添加我的JS代码。
var map;
var mgr;
var infowindow = new google.maps.InfoWindow();
function initialize() {
var myLatlng = new google.maps.LatLng(0, 0);
map = new google.maps.Map(document.getElementById("map"), {
center: myLatlng,
zoom: 12,
mapTypeId: "OSM",
mapTypeControl: false,
streetViewControl: false
});
map.mapTypes.set("OSM", new google.maps.ImageMapType({
getTileUrl: function (coord, zoom) {
return "http://tile.openstreetmap.org/" + zoom + "/" + coord.x + "/" + coord.y + ".png";
},
tileSize: new google.maps.Size(256, 256),
name: "OpenStreetMap",
maxZoom: 18
}));
var marker0 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.00945923805956, -77.05810546875), title: 'Quindío' });
google.maps.event.addListener(marker0, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(660); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=660" frameborder="0"></iframe>'); infowindow.open(map,marker0); });
var marker1 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(-4.188574, -69.93929), title: 'Amazonas' });
google.maps.event.addListener(marker1, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(34); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=34" frameborder="0"></iframe>'); infowindow.open(map,marker1); });
var marker2 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.5197222, -72.8875), title: 'Boyacá' });
google.maps.event.addListener(marker2, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(194); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=194" frameborder="0"></iframe>'); infowindow.open(map,marker2); });
var marker3 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.3316667, -75.8822222), title: 'Caquetá' });
google.maps.event.addListener(marker3, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(284); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=284" frameborder="0"></iframe>'); infowindow.open(map,marker3); });
var marker4 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.15, -73.65), title: 'Meta' });
google.maps.event.addListener(marker4, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(556); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=556" frameborder="0"></iframe>'); infowindow.open(map,marker4); });
var marker5 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.7933333, -75.4308333), title: 'Antioquia' });
google.maps.event.addListener(marker5, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(36); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=36" frameborder="0"></iframe>'); infowindow.open(map,marker5); });
var marker6 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.21, -77.26), title: 'Nariño' });
google.maps.event.addListener(marker6, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(574); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=574" frameborder="0"></iframe>'); infowindow.open(map,marker6); });
var marker7 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.62641376843295, -70.9881591796875), title: 'Arauca' });
google.maps.event.addListener(marker7, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(135); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=135" frameborder="0"></iframe>'); infowindow.open(map,marker7); });
var marker8 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.6, -74.0833333), title: 'Cundinamarca' });
google.maps.event.addListener(marker8, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(400); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=400" frameborder="0"></iframe>'); infowindow.open(map,marker8); });
var marker9 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.43, -75.22), title: 'Tolima' });
google.maps.event.addListener(marker9, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(765); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=765" frameborder="0"></iframe>'); infowindow.open(map,marker9); });
var marker10 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(7.1297222, -73.1258333), title: 'Santander' });
google.maps.event.addListener(marker10, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(691); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=691" frameborder="0"></iframe>'); infowindow.open(map,marker10); });
var marker11 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(3.4372222, -76.5225), title: 'Valle Del Cauca' });
google.maps.event.addListener(marker11, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(809); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=809" frameborder="0"></iframe>'); infowindow.open(map,marker11); });
var marker12 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(0, -76.1572265625), title: 'Putumayo' });
google.maps.event.addListener(marker12, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(651); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=651" frameborder="0"></iframe>'); infowindow.open(map,marker12); });
var marker13 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.35, -72.3833333), title: 'Casanare' });
google.maps.event.addListener(marker13, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(296); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=296" frameborder="0"></iframe>'); infowindow.open(map,marker13); });
var marker14 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(2.460181181021, -75.60791015625), title: 'Huila' });
google.maps.event.addListener(marker14, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(494); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=494" frameborder="0"></iframe>'); infowindow.open(map,marker14); });
var marker15 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.25, -70.21667), title: 'Vaupes' });
google.maps.event.addListener(marker15, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(848); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=848" frameborder="0"></iframe>'); infowindow.open(map,marker15); });
var marker16 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.184765, -67.488503), title: 'Vichada' });
google.maps.event.addListener(marker16, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(850); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=850" frameborder="0"></iframe>'); infowindow.open(map,marker16); });
var latlngbounds = new google.maps.LatLngBounds();
latlngbounds.extend(new google.maps.LatLng(6.00945923805956, -77.05810546875));
latlngbounds.extend(new google.maps.LatLng(-4.188574, -69.93929));
latlngbounds.extend(new google.maps.LatLng(5.5197222, -72.8875));
latlngbounds.extend(new google.maps.LatLng(1.3316667, -75.8822222));
latlngbounds.extend(new google.maps.LatLng(4.15, -73.65));
latlngbounds.extend(new google.maps.LatLng(5.7933333, -75.4308333));
latlngbounds.extend(new google.maps.LatLng(1.21, -77.26));
latlngbounds.extend(new google.maps.LatLng(6.62641376843295, -70.9881591796875));
latlngbounds.extend(new google.maps.LatLng(4.6, -74.0833333));
latlngbounds.extend(new google.maps.LatLng(4.43, -75.22));
latlngbounds.extend(new google.maps.LatLng(7.1297222, -73.1258333));
latlngbounds.extend(new google.maps.LatLng(3.4372222, -76.5225));
latlngbounds.extend(new google.maps.LatLng(0, -76.1572265625));
latlngbounds.extend(new google.maps.LatLng(5.35, -72.3833333));
latlngbounds.extend(new google.maps.LatLng(2.460181181021, -75.60791015625));
latlngbounds.extend(new google.maps.LatLng(1.25, -70.21667));
latlngbounds.extend(new google.maps.LatLng(6.184765, -67.488503));
map.fitBounds(latlngbounds);
new google.maps.Rectangle({
bounds: latlngbounds, map: map, fillOpacity: 0, strokeWeight: 0
});
}
google.maps.event.addDomListener(window,'load',initialize);
html, body, #map {
width: 100%;
height: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js"></script>
<div id="map"></div>
答案 0 :(得分:1)
您需要this example in the documentation
中的getNormalizeCoordinate
// Normalizes the coords that tiles repeat across the x axis (horizontally)
// like the standard Google map tiles.
function getNormalizedCoord(coord, zoom) {
var y = coord.y;
var x = coord.x;
// tile range in one direction range is dependent on zoom level
// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
var tileRange = 1 << zoom;
// don't repeat across y-axis (vertically)
if (y < 0 || y >= tileRange) {
return null;
}
// repeat across x-axis
if (x < 0 || x >= tileRange) {
x = (x % tileRange + tileRange) % tileRange;
}
return {
x: x,
y: y
};
}
代码段
var map;
var mgr;
var infowindow = new google.maps.InfoWindow();
function initialize() {
var myLatlng = new google.maps.LatLng(0, 0);
map = new google.maps.Map(document.getElementById("map"), {
center: myLatlng,
zoom: 12,
mapTypeId: "OSM",
mapTypeControl: false,
streetViewControl: false
});
map.mapTypes.set("OSM", new google.maps.ImageMapType({
getTileUrl: function(coord, zoom) {
var normalizedCoord = getNormalizedCoord(coord, zoom);
if (!normalizedCoord) {
return null;
}
var bound = Math.pow(2, zoom);
return "http://tile.openstreetmap.org/" + zoom + "/" + normalizedCoord.x + "/" + normalizedCoord.y + ".png";
},
tileSize: new google.maps.Size(256, 256),
name: "OpenStreetMap",
maxZoom: 18
}));
var marker0 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.00945923805956, -77.05810546875), title: 'Quindío' });
google.maps.event.addListener(marker0, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(660); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=660" frameborder="0"></iframe>'); infowindow.open(map,marker0); });
var marker1 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(-4.188574, -69.93929), title: 'Amazonas' });
google.maps.event.addListener(marker1, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(34); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=34" frameborder="0"></iframe>'); infowindow.open(map,marker1); });
var marker2 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.5197222, -72.8875), title: 'Boyacá' });
google.maps.event.addListener(marker2, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(194); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=194" frameborder="0"></iframe>'); infowindow.open(map,marker2); });
var marker3 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.3316667, -75.8822222), title: 'Caquetá' });
google.maps.event.addListener(marker3, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(284); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=284" frameborder="0"></iframe>'); infowindow.open(map,marker3); });
var marker4 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.15, -73.65), title: 'Meta' });
google.maps.event.addListener(marker4, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(556); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=556" frameborder="0"></iframe>'); infowindow.open(map,marker4); });
var marker5 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.7933333, -75.4308333), title: 'Antioquia' });
google.maps.event.addListener(marker5, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(36); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=36" frameborder="0"></iframe>'); infowindow.open(map,marker5); });
var marker6 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.21, -77.26), title: 'Nariño' });
google.maps.event.addListener(marker6, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(574); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=574" frameborder="0"></iframe>'); infowindow.open(map,marker6); });
var marker7 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.62641376843295, -70.9881591796875), title: 'Arauca' });
google.maps.event.addListener(marker7, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(135); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=135" frameborder="0"></iframe>'); infowindow.open(map,marker7); });
var marker8 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.6, -74.0833333), title: 'Cundinamarca' });
google.maps.event.addListener(marker8, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(400); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=400" frameborder="0"></iframe>'); infowindow.open(map,marker8); });
var marker9 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(4.43, -75.22), title: 'Tolima' });
google.maps.event.addListener(marker9, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(765); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=765" frameborder="0"></iframe>'); infowindow.open(map,marker9); });
var marker10 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(7.1297222, -73.1258333), title: 'Santander' });
google.maps.event.addListener(marker10, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(691); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=691" frameborder="0"></iframe>'); infowindow.open(map,marker10); });
var marker11 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(3.4372222, -76.5225), title: 'Valle Del Cauca' });
google.maps.event.addListener(marker11, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(809); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=809" frameborder="0"></iframe>'); infowindow.open(map,marker11); });
var marker12 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(0, -76.1572265625), title: 'Putumayo' });
google.maps.event.addListener(marker12, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(651); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=651" frameborder="0"></iframe>'); infowindow.open(map,marker12); });
var marker13 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(5.35, -72.3833333), title: 'Casanare' });
google.maps.event.addListener(marker13, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(296); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=296" frameborder="0"></iframe>'); infowindow.open(map,marker13); });
var marker14 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(2.460181181021, -75.60791015625), title: 'Huila' });
google.maps.event.addListener(marker14, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(494); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=494" frameborder="0"></iframe>'); infowindow.open(map,marker14); });
var marker15 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(1.25, -70.21667), title: 'Vaupes' });
google.maps.event.addListener(marker15, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(848); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=848" frameborder="0"></iframe>'); infowindow.open(map,marker15); });
var marker16 = new google.maps.Marker({ map: map, position: new google.maps.LatLng(6.184765, -67.488503), title: 'Vichada' });
google.maps.event.addListener(marker16, 'click', function() { infowindow.setContent('<div><a href="#" onclick="javascript: openRadWin(850); return false;"><img alt="Zoom" class="zoom" src="../../Content/img/zoom.png"/></a></div><iframe class="chart-thumbnail-iframe" width="240" height="200" src="ChartThumbnailViewer.aspx?rid=14&cid=59&mid=850" frameborder="0"></iframe>'); infowindow.open(map,marker16); });
var latlngbounds = new google.maps.LatLngBounds();
latlngbounds.extend(new google.maps.LatLng(6.00945923805956, -77.05810546875));
latlngbounds.extend(new google.maps.LatLng(-4.188574, -69.93929));
latlngbounds.extend(new google.maps.LatLng(5.5197222, -72.8875));
latlngbounds.extend(new google.maps.LatLng(1.3316667, -75.8822222));
latlngbounds.extend(new google.maps.LatLng(4.15, -73.65));
latlngbounds.extend(new google.maps.LatLng(5.7933333, -75.4308333));
latlngbounds.extend(new google.maps.LatLng(1.21, -77.26));
latlngbounds.extend(new google.maps.LatLng(6.62641376843295, -70.9881591796875));
latlngbounds.extend(new google.maps.LatLng(4.6, -74.0833333));
latlngbounds.extend(new google.maps.LatLng(4.43, -75.22));
latlngbounds.extend(new google.maps.LatLng(7.1297222, -73.1258333));
latlngbounds.extend(new google.maps.LatLng(3.4372222, -76.5225));
latlngbounds.extend(new google.maps.LatLng(0, -76.1572265625));
latlngbounds.extend(new google.maps.LatLng(5.35, -72.3833333));
latlngbounds.extend(new google.maps.LatLng(2.460181181021, -75.60791015625));
latlngbounds.extend(new google.maps.LatLng(1.25, -70.21667));
latlngbounds.extend(new google.maps.LatLng(6.184765, -67.488503));
map.fitBounds(latlngbounds);
new google.maps.Rectangle({
bounds: latlngbounds, map: map, fillOpacity: 0, strokeWeight: 0
});
}
google.maps.event.addDomListener(window,'load',initialize);
// Normalizes the coords that tiles repeat across the x axis (horizontally)
// like the standard Google map tiles.
function getNormalizedCoord(coord, zoom) {
var y = coord.y;
var x = coord.x;
// tile range in one direction range is dependent on zoom level
// 0 = 1 tile, 1 = 2 tiles, 2 = 4 tiles, 3 = 8 tiles, etc
var tileRange = 1 << zoom;
// don't repeat across y-axis (vertically)
if (y < 0 || y >= tileRange) {
return null;
}
// repeat across x-axis
if (x < 0 || x >= tileRange) {
x = (x % tileRange + tileRange) % tileRange;
}
return {
x: x,
y: y
};
}
body, html, #map {
height: 100%;
width: 100%;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js"></script>
<div id="map"></div>