mevans
Oct-15-2017, 15:16
I have seen on other threads questions regarding the use of a second monitor to show the Map in Cliffs of Dover and understand that it cannot be done. Also some players not from the UK would like to have a map on a second monitor so they can get use to the names of towns and cities etc. What I have been able to do is to use Google maps to show in real time the position of the players plane as they fly around southern England. Note that this will only work on single player missions and does not show the location of any other aircraft or feature apart for the 11 group airfields which I have added. It also shows 2017 England and not 1940 England. On the screen shot attached you will see the map on the right with a track showing a fight with bombers over Hornchurch airfield. it is not 100% accurate but it is quite close. Unfortunately it does take a bit of time to set up (took nearly 3 months to work it all out) but adds a bit of fun. It would also pay to keep the file name etc. the same until everything works otherwise you will have to edit the files as applicable.
There are two main files involved. The first is Master.txt which needs to be saved as a .cs file. Open the file in a txt editor and copy the contents. Paste the contents into a new txt file and save as Master.cs. At this stage is doesn't matter where it is saved. Open the Cliffs of Dover.txt file, copy the contents and paste into another txt file and save as Cliffs of Dover.php. Again doesn't matter where this is saved at this stage.
There are two things that are needed to be done to make the system work. First you will need to obtain an API key from Google Maps. https://developers.google.com/maps/documentation/embed/get-api-key will show you how to get this. Its quite simple and free. When you get your API key copy and paste it into the Cliffs of Dover.php file in the line near the bottom that over the text YOUR_API_KEY. Don't leave any spaces before of after the key.
The next step is to create a server on your computer which is needed to run the .php file. I used WAMP (which is free) and it works fine. Goggle WAMP download and follow the instructions. It can be a bit tricky but what this will do is allow you to set up a local server on your computer which is eded to run the .php file. WAMP needs to go in your root directory and is run from your hidden icons box on the lower right of your screen.
Once WAMP is downloaded and set up, there will be a folder WAMP64 in your root directory with a subfolder WWW. In WWW folder create another folder called CLOD. It is into this directory that you paste the Cliffs of Dover.php file.
Now the Master.cs file is the programme that runs when you play a mission. It retrieves the x and y coordinates of your aircraft, converts them roughly to lat and long and writes them into a txt file which will be created in your WWW/CLOD folder. The .php file needs to be pasted into same folder as your .mis file (typically C:\Users\name\OneDrive\Documents\1C SoftClub\il-2 sturmovik cliffs of dover - MOD\missions) and given the same name i.e. if you have a mission called London Burning.mis, then copy the .cs file into the same folder and rename it London Burning.cs. You do this for any mission that you want to use the Google Map.
Hopefully now it will all work. When you run it the first time start your mission first. If the word Map appears at the top of the screen then the data is being written into a text file called LatLong.txt in the WWW.CLOD folder. If it doesn't make sure the .cs file is named correctly. If the word Map does appear wait a couple of seconds and then Alt tab and open Chrome. Apparently Chrome is best for Google Maps and WAMP but it may work in other browsers. In the directory box (or whatever it is called) type in localhost/CLOD/Cliffs of Dover.php and press enter. What will now happen is that the .php file should run (may take a second or so) open a map. get the lat,long form the txt file, place a marker on the screen and centre the map on that location. The lat and long are updated every second and as you fly the marker is moved to the new location, a line is drawn from the previous position and the map pans to the new position. The next time you fly, the map will assume that you are at the last know position so I start the mission, Alt Tab to Chrome and refresh then back to CLOD. Refresh the map if you are at a different location.
Hopefully everything will work and you will get a same results as I do. Once it is all working feel free to have a look at the programmes (open in any text editor) and have a play. You can alter the timing interval, have only the marker and no line, have no line or marker and use simply as a map. Add aerodromes or other features as you like. If there are problems I will try to help but I am not a programmer and this is may first attempt at this sort of thing. And many thanks to FearlessFrog who provided the original .cs file that I copied and amended to get the x and y coordinates.
There are two main files involved. The first is Master.txt which needs to be saved as a .cs file. Open the file in a txt editor and copy the contents. Paste the contents into a new txt file and save as Master.cs. At this stage is doesn't matter where it is saved. Open the Cliffs of Dover.txt file, copy the contents and paste into another txt file and save as Cliffs of Dover.php. Again doesn't matter where this is saved at this stage.
There are two things that are needed to be done to make the system work. First you will need to obtain an API key from Google Maps. https://developers.google.com/maps/documentation/embed/get-api-key will show you how to get this. Its quite simple and free. When you get your API key copy and paste it into the Cliffs of Dover.php file in the line near the bottom that over the text YOUR_API_KEY. Don't leave any spaces before of after the key.
The next step is to create a server on your computer which is needed to run the .php file. I used WAMP (which is free) and it works fine. Goggle WAMP download and follow the instructions. It can be a bit tricky but what this will do is allow you to set up a local server on your computer which is eded to run the .php file. WAMP needs to go in your root directory and is run from your hidden icons box on the lower right of your screen.
Once WAMP is downloaded and set up, there will be a folder WAMP64 in your root directory with a subfolder WWW. In WWW folder create another folder called CLOD. It is into this directory that you paste the Cliffs of Dover.php file.
Now the Master.cs file is the programme that runs when you play a mission. It retrieves the x and y coordinates of your aircraft, converts them roughly to lat and long and writes them into a txt file which will be created in your WWW/CLOD folder. The .php file needs to be pasted into same folder as your .mis file (typically C:\Users\name\OneDrive\Documents\1C SoftClub\il-2 sturmovik cliffs of dover - MOD\missions) and given the same name i.e. if you have a mission called London Burning.mis, then copy the .cs file into the same folder and rename it London Burning.cs. You do this for any mission that you want to use the Google Map.
Hopefully now it will all work. When you run it the first time start your mission first. If the word Map appears at the top of the screen then the data is being written into a text file called LatLong.txt in the WWW.CLOD folder. If it doesn't make sure the .cs file is named correctly. If the word Map does appear wait a couple of seconds and then Alt tab and open Chrome. Apparently Chrome is best for Google Maps and WAMP but it may work in other browsers. In the directory box (or whatever it is called) type in localhost/CLOD/Cliffs of Dover.php and press enter. What will now happen is that the .php file should run (may take a second or so) open a map. get the lat,long form the txt file, place a marker on the screen and centre the map on that location. The lat and long are updated every second and as you fly the marker is moved to the new location, a line is drawn from the previous position and the map pans to the new position. The next time you fly, the map will assume that you are at the last know position so I start the mission, Alt Tab to Chrome and refresh then back to CLOD. Refresh the map if you are at a different location.
Hopefully everything will work and you will get a same results as I do. Once it is all working feel free to have a look at the programmes (open in any text editor) and have a play. You can alter the timing interval, have only the marker and no line, have no line or marker and use simply as a map. Add aerodromes or other features as you like. If there are problems I will try to help but I am not a programmer and this is may first attempt at this sort of thing. And many thanks to FearlessFrog who provided the original .cs file that I copied and amended to get the x and y coordinates.