Oracle Maps example - map scale bar



Instructions

This demo displays a scale bar inside the map area above.

Source code

  function showMap()
  {
    var baseURL  = "http://"+document.location.host+"/mapviewer";
    var mapCenterLon = -122.45;
    var mapCenterLat =  37.6706;
    var mapZoom      =  4;  
    var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,8307);
    mapview = new MVMapView(document.getElementById("map"), baseURL);
    mapview.addMapTileLayer(new MVMapTileLayer("mvdemo.demo_map")); 
    mapview.setCenter(mpoint); 
    mapview.setZoomLevel(mapZoom);
    mapview.display();
     
    scaleBar=new MVMapDecoration(new MVScaleBar(),0, 1, null, null, 4, -45);
    mapview.addMapDecoration(scaleBar);
    
    mapview.addMapDecoration(new MVMapDecoration(new MVNavigationPanel(),0,0,null,null,4,4)) ;
  }