Oracle Maps example - Misc. FOI utilities


Instructions

This demo shows some of the utility methods of each FOI object, such as ones that let you customize an FOI's info window and tool tip.

Source code

  function showMap() 
  {	
    var baseURL  = "http://"+document.location.host+"/mapviewer";
    var mapCenterLon = -122.45;
    var mapCenterLat =  37.7706;
    var mapZoom      =    4;  
    var mpoint = MVSdoGeometry.createPoint(mapCenterLon,mapCenterLat,8307);
    var mapview = new MVMapView(document.getElementById("map"), baseURL);
    mapview.addMapTileLayer(new MVMapTileLayer("mvdemo.demo_map"));   
    mapview.setCenter(mpoint);   
    mapview.setZoomLevel(mapZoom);    
    mapview.display();
    
    
    var mpolygon1 = MVSdoGeometry.createPolygon([-122.5,37.8,-122.45,37.85,-122.41,37.83],8307);             
    var foi1 = new MVFOI("1", mpolygon1, 'mvdemo.C.RED');
            
    //whether you can click the foi, defaule is true
    foi1.setClickable(true);
  
    foi1.setInfoWindow("info window of FOI");
    foi1.setInfoTip("infotip of FOI");
    //foi1.enableInfoTip(false);
    mapview.addFOI(foi1); 
    
  }