JSFiddle - React, Tailwind, and code Playground
HTML
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<div id="map_container">
<div id="map_canvas"></div>
</div>
CSS
#map_container { padding:0 !important; margin:0 !important; }
#map_canvas { height:800px; }
JavaScript
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;
function initMaps() {
$.getScript("http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobox/src/infobox.js").done(function (script, textStatus) {
var customMapTypeOptions = {
getTileUrl: function (coord, zoom) {
var normalizedCoord = getNormalizedCoord(coord, zoom);
if (!normalizedCoord) {
return null;
}
var bound = Math.pow(2, zoom);
console.log('http://img.photobucket.com/albums/v229/s15199d/' + normalizedCoord.x + '-' + (bound - normalizedCoord.y - 1) + '.png');
return 'http://img.photobucket.com/albums/v229/s15199d/' + normalizedCoord.x + '-' + (bound - normalizedCoord.y - 1) + '.png';
},
tileSize: new google.maps.Size(250, 250),
maxZoom: 0,
minZoom: 0,
radius: 1738000,
name: 'custom map'
};
var customMapType = new google.maps.ImageMapType(customMapTypeOptions);
var latlng = new google.maps.LatLng(0, 0), // center point
mapOptions = {
zoom: 0,
center: latlng,
draggable: true,
scrollwheel: false,
mapTypeControl: false,
panControl: false,
scaleControl: false,
zoomControl: true,
zoomControlOptions: {
style: google.maps.ZoomControlStyle.LARGE,
position: google.maps.ControlPosition.RIGHT_TOP
...