![]() |
[TUTORIAL] Create new maps for FsPassengers - Printable Version +- FsPassengers Forums (http://www.fspassengers.com/forum) +-- Forum: FsPassengers (http://www.fspassengers.com/forum/forumdisplay.php?fid=3) +--- Forum: FsPassengers Customizing (http://www.fspassengers.com/forum/forumdisplay.php?fid=6) +--- Thread: [TUTORIAL] Create new maps for FsPassengers (/showthread.php?tid=9891) |
[TUTORIAL] Create new maps for FsPassengers - DanSteph - 09-11-2005 Create new maps for FsPassengers ![]() Introduction: The maps are displayed in the dialog "show flight map" of the FsPassengers menu, There is 31 maps bundled with FsPassengers but you can add as much as 255. look first the Maps section of more download there are some maps already done here: http://www.fspassengers.com/?action=download&cat=Maps&sort=Date&page=&search=&searchtype=Title&download=submit It's easy to make new maps in FsPassengers even a map of your town taken that you have a minimum of abilities. You need first an image in JPG with a size of 635x292 and some tuning in a config file using the map_editor of FsPassengers. We'll see all that below. 1- Creating the map in JPG My best thought on this is to use "google image" to find a nice image of the map you want. Simply click on this link: http://images.google.com/images?q=austria+map Here we searched with the keyword "austria map" up to you to choose another country name but keep the "map" keyword. Now choose a nice map if possible EQUIDISTANT (mean longitude and latitude have the same ratio of pixel) edit it with your graphic program and resize the map to 635x292 Don't forget to add a frame border with any color you want, the map dialog display don't add a frame himself. Here we have finally our map of Austria with a black frame around the image: ![]() Rename this map with a comprehensive name ex: "Austria.jpg" and copy it to the folder: "FsPassengers/UI/map" Now we need to create a config file so FsPassengers know where is that area and what each pixel mean in longitude and latitude. 2- Creating the config file Take any of the existing config file in the folder "map", copy it and rename it to the exact same name then your image with a ".cfg" at the end, in our case: "Austria.cfg" First we need to edit the config file with notepad to indicate to FsPassengers the ratio pixel/longitude pixel/latitude, we can calculate that easily. the best way is to know the exact longitude width of your map and simply divid the pixel width by this value. If you have a longitude grid on the map this is easy, simply open the image in your graphic program measure the distance in pixel of the grid and make the division. If you don't have a grid you must take some points on the map and measure in pixel what's the distance. Example: go on this site: http://uk2.multimap.com/map/home.cgi?client=public&lang=&advanced=&db=AT click on the most left of austria map borderline and write down the longitude in decimal (number beetween "()" below the map) here we find: 9.4323 Now click on the right border line and write down the longitude here we find: 17.5171 The longitude width is: 17.5171 - 9.4323= 8.0848 Now in your graphic program measure the exact distance in pixel beetween the two border line we find exactly: 543 pixel The "PixelRatioPerDegreeX" of the config file is : 543 / 8.0848 = 67.1630 Now open your new Austria.cfg and write: LongitudeZeroInPixel =-611 LatitudeZeroInPixel =4334 PixelRatioPerDegreeX =67.1630 PixelRatioPerDegreeY =67.1630 We don't care yet about the other number we'll use the "map_editor" of FsPassengers to tune our map. 3-Using the Map_Editor Go to "Window Start menu->FsPassengers->tools->Map editor" Select your map "Austria" in the select box as below: ![]() Now we need to enter some remarquable points that we must align with the point on the map in austria we have two town that are also shown on the map, "Salszburg" and "innsbruck" go again to multimap site: ![]() And click on "Salszburg", take great care to note the number beetween "()" as showed in the red box below: ![]() Now we have: Salszburg= lon: 13.0256 lat: 47.8485 Innsbruck: lon: 11.2289 lat: 47.2403 Enter those number for the two remarquable points and click REFRESH DISPLAY BUTTON ![]() As you see on this map Innsbruck is now at 2059 pixel (PX) on the right from the left of our image and 1433 pixels (PY) below the top of our image, way outside. Now the game is simple: using the four button "up right left down" you must move the two cross of our "remarquable point" on Innsbruck and Salszburg town. The cross will be inside the image when the PX will be beetween 0 and 635 and PY beetween 0 and 292. TIPS TO GO FASTER: keeping CTL pressed while clicking on button change PX&PY number by hundred keeping SHF pressed while clicking on button change PX&PY numbers by dozen. For fine tune don't press a key PX&PY will move by one pixel only. If your map is Equidistant (mean same ratio lon/lat) it will be easy and your map will be ready to use in FsP don't forget to click "WRITE TO CURRENT CFG" button so the config file is updated with the new "map center" value. ![]() If your map is NOT equidistant as in the Austria map in fact (innsbruck cross too high when salszburg cross is ok) you will need to have different value for PixelRatioPerDegreeX and PixelRatioPerDegreeY in the config file, either you do the trial and error method and hit refresh each time you edit the config file with notepad to see the change (as I have done because I'm lazy) either you measure again the latitude and pixel beetween two vertical point and make the division to have the vertical (Y) pixel/lat ratio. I have found for this map finally this number in the Austria.cfg file: LongitudeZeroInPixel =-611 LatitudeZeroInPixel =4334 PixelRatioPerDegreeX =66.7920 PixelRatioPerDegreeY =87.7920 Don't forget to upload your new map in the "maps section" of the more download area ![]() here: http://www.fspassengers.com/?action=download&cat=upload Post Edited ( 11-09-05 13:33 ) |