This discussion is archived
7 Replies Latest reply: May 17, 2013 12:57 PM by lqian RSS

Can't display a Tile Layer using JAVA API V2 (based on HTML5)

945537 Newbie
Currently Being Moderated
Hi Experts,

I am trying to display a tile layer using JAVA API V2 but i get the below error and nothing shows after that.

MAPVIEWER-05501: Map tile layer not found. Check map tile layer name and/or data source name.
Source: OM.layer.Tilelayer.getTileLayerConfig
*[mvdemo.demo_map]*

I tried with chrome and firefox browsers which supports HTML5 but same issue. Here is the html code i am using
<html>
<head>
<title></title>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<script type='text/javascript' src='http://localhost:8282/mapviewer/jslib/v2/oraclemapsv2.js'></script>
<style type= 'text/css '>body {cursor:default;}</style>
<script language="JavaScript" type="text/javascript">
function showMap()
{ 
var baseURL = "http://"document.location.host"/mapviewer";
var mapCenterLon = -122.45;
var mapCenterLat = 37.6706;
var mapZoom = 4; 
var mpoint = new OM.geometry.Point(mapCenterLon,mapCenterLat,8307);
var map = new OM.Map(
document.getElementById('map'),
{
mapviewerURL: baseURL
}) ; 
var tileLayer = new OM.layer.TileLayer(
"baseMap", 
{
dataSource:"mvdemo", 
tileLayer:"demo_map", 
tileServerURL:baseURL+"/mcserver"
}); 
map.addLayer(tileLayer) ;
navigationPanelBar=new OM.control.NavigationPanelBar();
map.addMapDecoration(navigationPanelBar);
map.setMapCenter(mpoint);
map.setMapZoomLevel(mapZoom) ; 
map.init() ;
} 
</script>
</head>
<body onload="javascript:showMap()">
    <DIV id=map style="width:99%;height:99%"></DIV>
</html>
However, I am successful in using the same tile Layer with JAVA API V1

Please share your thoughts as what could be the fix

Thanks
Nag

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points