• Which the release of FS2020 we see an explosition of activity on the forun and of course we are very happy to see this. But having all questions about FS2020 in one forum becomes a bit messy. So therefore we would like to ask you all to use the following guidelines when posting your questions:

    • Tag FS2020 specific questions with the MSFS2020 tag.
    • Questions about making 3D assets can be posted in the 3D asset design forum. Either post them in the subforum of the modelling tool you use or in the general forum if they are general.
    • Questions about aircraft design can be posted in the Aircraft design forum
    • Questions about airport design can be posted in the FS2020 airport design forum. Once airport development tools have been updated for FS2020 you can post tool speciifc questions in the subforums of those tools as well of course.
    • Questions about terrain design can be posted in the FS2020 terrain design forum.
    • Questions about SimConnect can be posted in the SimConnect forum.

    Any other question that is not specific to an aspect of development or tool can be posted in the General chat forum.

    By following these guidelines we make sure that the forums remain easy to read for everybody and also that the right people can find your post to answer it.

P3D v4 Once again about custom map

I'm using Editpad.
<ctrl>+E starts my web broser (firefox). Or look in your meu bar , submeu, to call the webbroser.
File will be loaded into the browser.

Didn't hear about it. And what does it give? Browser will show error in the code?
 
It's strange... I tried many diffrent variantes, but when i add this
Code:
<Element>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((@c:NearestVorCurrentTrueBearing,degrees) (A:GPS MAGVAR, degrees) - d360)%!03d! &#xB0;M\n
%((@c:NearestVorCurrentDistance,nmiles))%!.1f! NM\n
%((@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees) (@c::NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1.4"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,nmiles) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor1,nmiles) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>

i can see bearing and distance to VOR (don't know which one VOR), and ATTENTION - it is always the same!
View attachment 46196View attachment 46197View attachment 46198

It doesn’t matter which airport we are on and on which plane heading! It always show bearing 349deg and distance - 0nm. And don't show VOR name (ident). Maybe this GPS variables is broken on P3D v4? Has anyone noticed this?

Hi Alexey

The above is wrong , you need to treat your VOR in a similar way that you did for Flight Plan Waypoints .
You need 8 complete Element sections , each contains the following ,

** Declaration of index number from Nearest VOR serch for 8 VOR's , in your above code it was
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine)) this is for index 00 .

** then a GEOCALC to determine the VOR location relative to your aircraft , what you did here ,
" %((@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees) (@c::NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers)) " is incomplete , please check Wpt example and do it properley .

** It is important to understand that 3 aspects position your symbol as follows ,
(1) the GEOCALC and <Axis X="-5" Y="28"/>
(2) the <Position X="0" Y="0" /> for your symbol
(3) the +/- 28 value within the <Nonlinearity>

Cheers
Karol
EDIT , possible format for GEOCALC might be ,
Code:
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance,kilometers))
 
Last edited:
Hi Alexey

The above is wrong , you need to treat your VOR in a similar way that you did for Flight Plan Waypoints .
You need 8 complete Element sections , each contains the following ,

** Declaration of index number from Nearest VOR serch for 8 VOR's , in your above code it was
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine)) this is for index 00 .

** then a GEOCALC to determine the VOR location relative to your aircraft , what you did here ,
" %((@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees) (@c::NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers)) " is incomplete , please check Wpt example and do it properley .

** It is important to understand that 3 aspects position your symbol as follows ,
(1) the GEOCALC and <Axis X="-5" Y="28"/>
(2) the <Position X="0" Y="0" /> for your symbol
(3) the +/- 28 value within the <Nonlinearity>

Cheers
Karol
EDIT , possible format for GEOCALC might be ,
Code:
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance,kilometers))

Hi Karol! Thanks for response!

I tried many different versions, and that which you cited as an example.
With this version - symbol (and other information) not showing.
Code:
<Element>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearingvor1,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1.4"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor1,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>

<Element>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%(l0 ++ (@c:NearestVorItemsNumber) 1 + min (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearingvor2,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor2,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1.4"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor2,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>

With this version symbol is showing, but without any discription and stay in one place.
Code:
<Element>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentICAO))%!s!\n
%((@c:NearestVorCurrentDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1.4"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor1,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>


I begin to suspect that in P3D these variables do not work at all. But in the default GPS in page nrst - showing vor, ndb, intersection etc right!
 
I begin to suspect that in P3D these variables do not work at all. But in the default GPS in page nrst - showing vor, ndb, intersection etc right!

This will indeed work in P3D. Follow Karol's advice about using separate elements for each object you want to display.

Maybe you should check Bob's FSMAP-Guidebook , page 136.
"Transforming distance and bearing into pixel position"

Referring back to #63, I mentioned that I use a different calibration approach and rotation method, so you should not mix the two at this point. When designing an overlay scheme, understand that the XML gauge unit grid invariably has different scales in the X and Y directions. As an example, 20 gauges units in the Y direction might represent 250 meters in the real world, but in the X direction, 20 gauge units may cover only 240 meters. Even when the gps map is X="299" Y="299", the X and Y XML scales are usually different. Contrast that to the gps map where 200 physical screen pixels in the X direction represents the same earth distance as 200 pixels in the Y direction (of course, we're talking <Zoom> 500,000 or less, sinusoidal projection). To compensate for the different scale systems, I compute the real world distance offset (meters x and meters y) of the overlay point from the aircraft, rotate the point in gps map space - not in XML space - using a 2D transform to get the rotated x,y position, and then convert that x,y pair back to XML gauge units using the XML scales. I measure XML scales using LayerRangeRings with TrackUp=0.

I prefer this way because I'm not satisfied with the accuracy of overlay placement when rotating vectors in the XML coordinate space, particularly when Trackup=1, which is the normal navigation display configuration. At some point, you might want to give both approaches a try and see what you think.

Bob
 
Thanks Bob, I will try to understand your response (it's a little bit hard for me at the moment ).
I think need to check GPS vars in p3d. For example, make a simple string with nearest VOR bearing or distance (3 digits) and 0lacr it on the map. Without sumbols, shifts and geocalc position of it and my plane.
 
Guys, i was tested it....
For example add
Code:
<Element>
    <Position X="150" Y="150"/>
<FormattedText X="55" Y="30" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8" Bold="Yes" Adjust="left" Color="dodgerblue" VerticalAdjust="Center" Multiline="No" Fixed="No">
<String>%((C:p3dgps:NearestVorCurrentTrueBearing, degrees))%!3d!</String>
</FormattedText>
</Element>

to my map. I think i will be see 3 digits of bearing to nearest VOR, but NO it's always display "0"!!! I tried many diffrent variantes like a nearest VOR ICAO (string), ident, distance (meters) etc etc.... but it always show 0 or show nothing if it icao or ident. Are you sure GPS vars working in P3D? I do something wrong?
 
Are you sure GPS vars working in P3D? I do something wrong?


Note - C:fs9gps, not C:p3dgps

The GPS variables work in P3D (all versions). If your code doesn't work, you possibly have an indexing problem which is one of the points Karol was making in #82, but it could be something else.

Would you please post more of your code so people can see what's going on?

Bob
 
Last edited:
Note - C:fs9gps, not C:p3dgps

I tried all versions.

Would you please post more of your code so people can see what's going on?

Yes. No problem.
I was try to add custom symbols here. Example of macros and code for VOR above.
Code:
<Gauge Name="KINO" Version="1.0">
 <Image Name="KINO_Background" Bright="Yes" ImageSizes="299,299"/>
   <Update Frequency="18"/>
<Element>
      <Visible>
      (A:Circuit general panel on, bool)
      (A:ELECTRICAL MASTER BATTERY,bool)


      and
      </Visible>
 <Element>
  <Visible>(L:MFD SWITCH, enum) 2 ==</Visible> 
  <Position X="0" Y="0"/>
   <Image Name="KINO_KURS_Background.bmp" Bright="Yes" ImageSizes="299,299"/>

 <Macro Name="c">C:fs9gps</Macro>
<Macro Name="g">C:fs9gps</Macro>

<Macro Name="eta">
%((@c:FlightPlanWaypointETA,hours) flr 24 % )%!02d!:%((@c:FlightPlanWaypointETA,minutes) flr 60 %)%!02d!
</Macro>


 <Update Hidden="Yes">
               (L:map NDzoom,number) 0 == if{
                14 (&gt;L:map NDzoom,number)
                4 (&gt;L:NDZoomfactor,number)
                }


(A:GPS POSITION LAT,radians) (>@c:NearestVorCurrentLatitude,radians) (A:GPS POSITION LON,radians) (>@c:NearestVorCurrentLongitude,radians) 8 (>@c:NearestVorMaximumItems) 200 (>@c:NearestVorMaximumDistance,nmiles)


 </Update>


 <!--  КАРТА -->
    <Element Name="Map">
    <MaskImage Name="KINO_MASK.bmp" ImageSizes="299,299">
    </MaskImage>
    <Position X="0" Y="0"/>
     <CustomDraw Name="fs9gps:map" X="299" Y="299" LayerFlightPlan="Yes"
        FlightPlanLineWidth="2" Bright="Yes"
        ActiveColorLayerFlightPlan="0x7010B0"
        PastColorLayerFlightPlan="0xffffff"
        ColorLayerFlightPlan="0x7010B0"
        ColorLayerVORs="0x00ff00"
        ColorLayerNDBs="0x00ff00"
        CenterX="150" CenterY="260">
                <Zoom>(L:map NDzoom,number) 1000 * 2 / </Zoom>
                <Latitude>(A:GPS POSITION LAT, Radians)</Latitude>
        <Longitude>(A:GPS POSITION LON, Radians)</Longitude>
        <Heading>(A:GPS GROUND TRUE HEADING, Radians)</Heading>  //GPS GROUND TRUE TRACK
        <UpdateAlways>1</UpdateAlways>
            <LayerAirports>1</LayerAirports>
             <DetailLayerAirports>4</DetailLayerAirports>
             <TextDetailLayerAirports>1</TextDetailLayerAirports>
              <ColorLayerAirportsUntowered>0x35FF00</ColorLayerAirportsUntowered>
             <ColorLayerAirportsTowered>0xffffff</ColorLayerAirportsTowered>
        <DetailLayerTerrain>1</DetailLayerTerrain>
        <TextColorLayerAirports>0xffffff</TextColorLayerAirports>
        <TextColorLayerNDBs>0x00ff00</TextColorLayerNDBs>
        <LayerVehicles>1</LayerVehicles>
        <DetailLayerVehicles>2</DetailLayerVehicles>
        <TextDetailLayerVehicles>1</TextDetailLayerVehicles>
        <ObjectDetailLayerVehicles>0x2 0x4 0x10</ObjectDetailLayerVehicles>
        <ColorLayerVehicles>(@g:setup_ColorTerrain) 1 == if{ 0x006666 } els{ 0x44ffff }</ColorLayerVehicles>
        <TextColorLayerVehicles>0xffffff</TextColorLayerVehicles>
        <TrackUp>1</TrackUp>
        </CustomDraw>
    </Element>


    <Element>
    <Visible>(A:GPS IS ACTIVE FLIGHT PLAN, bool) !</Visible>
    <Position X="0" Y="0"/>
    <Image Name="KINO_MAP_NOT_READY.bmp" Bright="Yes" ImageSizes="299,299">
    </Image>
   </Element>


<!--10 KM не используется-->
   <Element>
    <Visible>(L:map NDzoom, number) 14 ==</Visible>
    <Position X="0" Y="0"/>
    <Image Name="KINO_10_KM_NOT_IN_USE.bmp" Bright="Yes" ImageSizes="299,299">
    </Image>
   </Element>

  <!-- ДУГА -->
            <Element>
                <Position X="149" Y="260" />
                <CustomDraw Name="fs9gps:rose" X="299" Y="430" CenterX="149" CenterY="214" Radius="214"  LineWidth="2" Font="Tu2X4_VSS" Bold="Yes" FontSize="10" BigFontSize="9" Bright="Yes">
                    <Color>0xF0D0D0</Color>
                    <Heading>(A:PLANE HEADING DEGREES MAGNETIC, Radians)</Heading>
                    <Pivot X="149" Y="214" />
                </CustomDraw>
            </Element>



WP -1

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="0xffffff" VerticalAdjust="Center">
<String>\{bo}
%((@c:FlightPlanActiveWaypoint) s0 1 - (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing0,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance0,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="0xffffff" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing0,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance0,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing0,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance0,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP Active

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="Magenta" VerticalAdjust="Center">
<String>\{bo}
%((@c:FlightPlanActiveWaypoint) s0 (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing1,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance1,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="Magenta" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance1,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance1,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>


WP 1

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="white" VerticalAdjust="Center">
<String>\{bo}
%(l0 ++ (@c:FlightPlanActiveWaypoint) 1 + min (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing2,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance2,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Visible>(L:SPRAV, bool)</Visible>
<Element>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>@eta</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
</Element>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="white" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance2,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance2,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP 2

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="white" VerticalAdjust="Center">
<String>\{bo}
%(l0 1 + ++ (@c:FlightPlanActiveWaypoint) 2 + min (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing3,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance3,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Visible>(L:SPRAV, bool)</Visible>
<Element>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>@eta</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
</Element>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="white" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing3,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance3,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing3,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance3,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP 3

<Element>
    <MaskImage Name="KINO_MASK.bmp" ImageSizes="299,299">
    </MaskImage>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="white" VerticalAdjust="Center">
<String>\{bo}
%(l0 2 + ++ (@c:FlightPlanActiveWaypoint) 3 + min (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing4,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance4,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Visible>(L:SPRAV, bool)</Visible>
<Element>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>@eta</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
</Element>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="white" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing4,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance4,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing4,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance4,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP 4

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="white" VerticalAdjust="Center">
<String>\{bo}
%(l0 3 + ++ (@c:FlightPlanActiveWaypoint) 4 + min (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing5,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance5,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Visible>(L:SPRAV, bool)</Visible>
<Element>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>@eta</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
</Element>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="white" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing5,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance5,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing5,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance5,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP 5

<Element>
<FormattedText X="35" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="white" VerticalAdjust="Center">
<String>\{bo}
%(l0 4 + ++ (@c:FlightPlanActiveWaypoint) 5 + min (>@c:FlightPlanWaypointIndex))
%((@c:FlightPlanWaypointIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:FlightPlanWaypointLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:FlightPlanWaypointLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearing6,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distance6,kilometers))
</String>
<Axis X="-5" Y="8"/>
</FormattedText>
<Element>
<Visible>(L:SPRAV, bool)</Visible>
<Element>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>@eta</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
</Element>
<Element>
<Position X="-2" Y="-2" />
<Circle Color="white" Bright="Yes" Radius="2" LineWidth="1"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>
<Shift>
<Value>(L:Bearing6,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distance6,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearing6,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distance6,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="270"/>
</Element>

WP 6, 7, 8.... etc



     <!-- TCAS-->
     <Element>
<MaskImage Name="KINO_MASK.bmp" ImageSizes="299,299">
    </MaskImage>
     <Position X="0" Y="0"/>
     <CustomDraw Name="fs9traffic:tcas" X="299" Y="299" CenterX="150" CenterY="260" SymbolSize="3.5"
               OtherColour="0x7fffff" ProximityColour="0x7fffff"
                MaxDispNumAct="15" MaxRange="700" >
                <Heading>(A:PLANE HEADING DEGREES MAGNETIC, degrees)</Heading>
                <Range>(L:map NDzoom,number) 1000 * 2 / </Range>
                <Brightness> (C:fs9traffic:Brightness,number) 127 max 255 min  d (&gt;C:fs9traffic:brightness,number)</Brightness>
            </CustomDraw>
    </Element>
Not closing, because below are different icons and display options....
 
%((@c:NearestVorItemsNumber) s0 (>@c:NearestVorCurrentLine))

As Karol mentioned in #82, this is not the correct way to set the index (NearestVorCurrentLine) for your NearestVOR search. NearestVorItemsNumber is the total number of VORs actually returned in the NearestVor search. You cannot use that to set the index pointer. The index value should start with 0 then progress thru 1, 2, 3 ...

The first VOR returned in the NearestVOR search would be %(0 (>@c:NearestVorCurrentLine))

The second would be %(1 (>@c:NearestVorCurrentLine)) and so forth

The next one is %(2 (>@c:NearestVorCurrentLine)) and so forth.

Bob
 
Hi Bob!

The first VOR returned in the NearestVOR search would be %(0 (>@c:NearestVorCurrentLine))

Thank you for the clarification.

I understand correctly - that this code should work?
Code:
<Element>
<FormattedText X="45" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%(0 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearingvor1,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1.4"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor1,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor1,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>

Or like this?
Code:
<Element>
<FormattedText X="45" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%(l0 ++ (@c:NearestVorItemsNumber) 1 + min (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearingvor2,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor2,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor2,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>

<Element>
<FormattedText X="45" Y="10" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%(l0 1 + ++ (@c:NearestVorItemsNumber) 2 + min (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
%((A:PLANE LATITUDE,degrees) (>@c:GeoCalcLatitude1,degrees) (A:PLANE LONGITUDE,degrees) (>@c:GeoCalcLongitude1,degrees) (@c:NearestVorCurrentLatitude,degrees) (>@c:GeoCalcLatitude2,degrees) (@c:NearestVorCurrentLongitude,degrees) (>@c:GeoCalcLongitude2,degrees)
(@c:GeoCalcBearing,degrees) (>L:Bearingvor3,degrees) (@c:GeoCalcDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor3,kilometers))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Element>
<Position X="-7" Y="-7" />
<Circle Color="dodgerblue" Bright="Yes" Radius="7" LineWidth="2"></Circle>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Element>
<Position X="0" Y="0" />
<Polygon Color="dodgerblue" Bright="Yes" LineWidth="1"> <Point X="0" Y="-3"/><Point X="3" Y="2"/> <Point X="-3" Y="2"/></Polygon>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
<Shift>
<Value>(L:Bearingvor3,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor3,kilometers) * -1 * </Value>
<Nonlinearity>
<Item Value="-28" Y=  "110"/>
<Item Value=   "0" Y="260"/>
<Item Value= "28" Y="410"/>
</Nonlinearity>
</Shift>
<Shift>
<Value>(L:Bearingvor3,radians) (A:PLANE HEADING DEGREES TRUE,radians) - sin (L:Distancevor3,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
<Clip Left="0" Right="299" Top ="48" Bottom="290"/>
</Element>
 
For you VOR symbols, it will be the first version above. Please test it and see!

Bob
 
Back
Top