Cache Tiles From local host arcgis server not displaying in OpenLayer web map

581
0
03-26-2014 04:22 PM
OlabodeOlushi
New Contributor
Hello,

I'm having a bit of challenge with my cached tiles from local host arcgis server displaying. I'm currently using OpenLayer to test a cache tileset of a particular area. Every time i load the code it shows the cached tiles in pink boxes on the map and does not display. Can anybody please assist on how i can go about with this. Here's a sample code of what i have.

<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset='utf-8' />
<title>Olabode OpenLayer</title>
<script type='text/javascript' src='OpenLayers.js'></script>
<script src="http://maps.google.com/maps/api/js?sensor=false"></script>
<script type='text/javascript'>

var map;

function init() {
map = new OpenLayers.Map('map_element', {});

cacheLayer = new OpenLayers.Layer.ArcGISCache( "ArcGISCache",
                    "http://localhost:6080/arcgis/rest/services/Shane/Niagara_Cache_Example/ImageServer", {
                        isBaseLayer: true,
    
                    });
    
map.addLayer(cacheLayer);

map.addControl(new OpenLayers.Control.LayerSwitcher({}));
map.addControl(new OpenLayers.Control.PanZoomBar({}));


if(!map.getCenter()){
map.zoomToMaxExtent();
}
}

</script>
</head>

<body onload='init();'>
<div id='map_element' style='margin: 0; width: 1570px; height: 740px; box-shadow: 0px 5px 5px 3px #6B9000'>
</div>
</body>
</html>
0 Kudos
0 Replies