I'm working on a project that converts digital histology (microscope) slide images to 256x256 pixel JPEG tiles arranged in the Google Maps architecture. Being that these tissues are set against a background that is entirely white (see example here), I'm using a program that, when converting the microscope slide files to tiled JPEGs, it also deletes entirely white tiles. This saves a huge amount of storage space, as well as results in many fewer files to upload to a server, which is helpful since I do not have control over the server (I'm using Google Storage).
However, this leaves blank holes in the image. I'm trying to get the Google Maps script to load a single all-white JPEG image when a tile is not present at that location. I cannot find an answer anywhere, and my programming skills are novice-level at best. The closest thing I can find is using tile overlays, but I won't always know which tiles need to be replaced, and it seems like that is necessary information in order to fill in these unfilled areas.
My current (very very basic script) is as follows:
< html > < head >
< script type = "text/javascript"
src = "https://maps.googleapis.com/maps/api/js?sensor=true&v=3" > < /script>
<script type="text/javascript
">
function initialize()
{
geocoder = new google.maps.Geocoder();
var myOptions = {
zoom: 2,
center: new google.maps.LatLng(0,0),
mapTypeControl: false,
streetViewControl: false,
navigationControl: true,
mapTypeId: google.maps.MapTypeId.ROADMAP
}
map = new google.maps.Map(document.getElementById("
map_canvas "), myOptions);
var VM_Map = new google.maps.ImageMapType({
name: 'Digital Histology'
alt: 'Digital Histology',
getTileUrl: function(coord, zoom) {return customGetTileURL(coord, zoom);},
tileSize: new google.maps.Size(256, 256),
minZoom: 1,
maxZoom: 9,
isPng: false
});
map.mapTypes.set('VM_Map', VM_Map);
map.setMapTypeId('VM_Map');
}
function customGetTileURL(a,b) {
return 'SERVER_PATH' + b + '/' + a.y + '/' + a.x + '.jpg'
}
</script>
</head>
<body id="
body " style="
margin: 0px;
padding: 0px;
overflow: hidden;
" onLoad="
initialize()
" >
<div id="
map_canvas " style="
width: 100 % ;
height: 100 % ;
"></div>
</body>
</html>
Any suggestions would be deeply appreciated.