Oracle Maps example - get FOI properties

Show properties of the FOI with ID:

Instructions

This demo shows how to obtain a specific FOI's properties that are returned as part of the database query for a Theme based FOI layer. Each FOI displayed on the map has a unique ID associated with it. Application can use this ID to get the FOI object and its associated properties.
In the above text field, enter an id such as 5 or 7, and then click the 'Show properties' link.

Source code

Here is the JavaScript code.
	  var themebasedfoi;
	  
	  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);    
		
		themebasedfoi = new MVThemeBasedFOI('themebasedfoi1','mvdemo.customers');
		
		themebasedfoi.setBringToTopOnMouseOver(true);
		mapview.addThemeBasedFOI(themebasedfoi);
			  
		mapview.display();
	  }
	  
	  function getQueryResult()
	  {
		var obj = document.getElementById("obj");
		
		var attrs = themebasedfoi.getFOIData()[obj.value].attrs;
		var imgurl = themebasedfoi.getFOIData()[obj.value].imgurl;
		alert("Attrs:" + attrs + "\n imgURL:" + imgurl) ;
	  }                     
	  
  
And here is how the function getQueryResult is wired to the HTML link 'Show Properties' and the ID field.
      <a href="javascript:getQueryResult()">Show properties</a> of the FOI with ID: <input id="obj" type=text value="0">