I’ll start a series of posts to show how to create a little more complex Federation. This post will intruduce the MapViewer.
If you want to give a look and/or compile the sources than you can checkout it from the github repository here. You will need Maven to compile. Don’t forget to add Portico into your local repository ( a compiled version is in 3rdparty folder – v2.0.0 ).
You can download the runnable version from here. The WAR file you must deploy to Tomcat 7 and the JAR files you can run from terminal:
#> java -jar tank.jar
The Portico JAR is embedded. No configuration is needed.
The project will contemplate a Map Federate, an Aircraft Federate and a Tank Federate, but will be ready to extend to show other units by extending BasicUnit.
You can find a video here.
The interface uses Ajax requests to get unit positions in GeoJSON format. The server answers to this requests by using a Struts2 action to create the GeoJSON data from the Tanks list. The Tanks list you already know how to create.
I’ll give a Log system too. The log content comes directly from the Federate and from the Ambassador. A little screen to see units details will complete the features.
To keep the simply, I will not create a full simulation. All units will moves on a staight line from left to right ( longitudinal moviment ). I’ll achieve this by adding 0.001 to the longitude value.
Pin icons from Map Icons Collection. I’ll start working on next post and show the SOM and FOM. You can use my work as you wish, but it should give me proper credit.