logo CNRS

ForeFire

logo UNIV
Class Index | File Index

Classes


Class Index

_global_


Firesim


Example website Google Maps

Example website Google Earth

ForeFire API Tutorial


Exemple 1 : Get a state

See an example
 // System initialization
 var fs = new Firesim();
 fs.init([Latitude], [Longitude], [Date], [WindX], [WindY]);
 
 // Processes the first simulation step
 fs.step();

 // Use the custom function 'fct' to process the KML results
 fs.getLastState("KML", fct); 
                

Exemple 2 : Engage a simulation

See an example
 // System initialization
 var fs = new Firesim();
 fs.init([Latitude], [Longitude], [Date], [WindX], [WindY]);
 
 // Step configuration
 fs.setNumberOfSteps(50);
 fs.setOutputInterval(1000);
 
 // Engage simulation and processes each JSON result via the 'fct' function
 fs.engage("JSON", fct);
 
                

Exemple 3 : Reload a simulation

 // System initialization with a folder name
 var fs = new Firesim([Name of a Simulation Folder]);
 
 // Reload all calculated states into a TimeMapDataset
 fs.getAllStatesInTimemap(tm, tm.datasets['fire']);
 
                

Exemple 4 : Init from a polyline

See an example
 // System initialization
 var fs = new Firesim();
 fs.initFromPolyline([[42, 9], [41.99, 9], [41.99, 8.99], [42, 8.99]], new Date(), 3, 3)
 
 // Use the custom function 'fct' to process the KML results
 fs.getLastState("JSON", fct);
 // Processes the next simulation step
 fs.step();
                

Exemple 5 : Change method of ajax requests

 // From index.html when import JS script 
 <script src="http://forefire.univ-corse.fr/api/v1/forefireAPI.js?requestType=GET"></script>
 
                

Exemple 6 : Add another point of ignition while a simulation is running

See an example
 // System initialization
 var fs = new Firesim();
 fs.init([Latitude], [Longitude], [Date], [WindX], [WindY]);
 
 // Some work 
 [...]

 // Adding a point of ignition from a google.maps.LatLng Object
 // Will add a point of ignition at [42.9, 8.7] starting at the current client date
 var mylatlng = new google.maps.LatLng(42.9, 8.7);
 fs.addIgnition(new Date(), mylatlng.lat(), mylatlng.lng());
                

Exemple 7 : Add a fuel break

See an example
 // Initialisation and some work 
 [...]

 // Adding a fuel break from two points
 var startBreak = new google.maps.LatLng(42.99, 8.7);
 var endBreak = new google.maps.LatLng(42.97, 8.72);
 fs.addBreak(new Date(), startBreak.lat(), startBreak.lng(), endBreak.lat(), endBreak.lng());
                
Documentation generated by JsDoc Toolkit 2.4.0 on Wed Oct 02 2013 15:26:17 GMT+0200 (CEST)