• 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


Ok, thanks. I will try to do it. In first time i'm want to show custom VOR symbols on map.
 
Hi Bob!

Anyway, great job on this. Karol's work is always imaginative and very nice to look at.

Absolutely agree!

Bob, can you help me with traffic overlay in my customdraw map for P3D v4? I was read this topic about it https://www.fsdeveloper.com/forum/threads/closure-time-of-2-aircraft.444004/page-2 (and other the same) but don't understand wich varriables I need to use. In first I'm want to show custom traffic sybols on map, without avoidance (TA, RA it is too hard for me), but with showing vertical speed arrows (climb or descend). And not like a default traffic layer. I think I must be use a image (bmp) like in fs guidebook. Also use C: ITrafficInfo lat and long, and my plane position. But how to connect it?
 
Last edited:
Alexey,

There is no simple answer. XML TCAS is a bit complicated and involves XML object placement on top of a CustomDraw map (a true “hack” - a goal outside of the creator's (MS) original objective) as well as ITrafficInfo VehicleID tracking using XMLVars arrays.

I spent much time documenting these techniques in the fsmap guidebook so I would ask you to study that. Also provided are XML gauges that show the code.

With Karol’s assistance, I hope you’re getting comfortable with XML object overlays although I will point out that my approach to both scale calibration and gauge unit x,y calculation differs from that utilized by Jan Van Harten and Karol. You need to understand that from the beginning as you take a look at my TCAS script and compare it to your ND gauge. There’s often more than one way to do things and Karol’s techniques are fine.

When it comes to keeping track of AI traffic, one needs to understand the importance of ITrafficInfo:SelectedVehicleID and how to make VID variable arrays that contain the previous update cycle positional data of specific AI traffic in order to compute Range Tau. This was a main topic of discussion in the link you provided above.

You don’t have to use .bmp images for the TCAS traffic display. I use XML drawn Polygons, Circles and Polylines.

Regarding your previous question about custom VOR symbols, I would suggest that you first get the VOR symbol overlay working correctly and then turn your attention to colorizing the VOR that NAV1 is tuned to – that will be an easy step. This will indeed involve a Nearest VOR search, so that’s something new to learn. GPS Guidebook.

Bob
 
Last edited:
Hi Bob! Thanks for response.

ITrafficInfo VehicleID tracking using XMLVars arrays.

Always? Can't do without it?

I spent much time documenting these techniques in the fsmap guidebook so I would ask you to study that.

Yes, I read, more than once:-) try to understand and reading again and again.

AI traffic in order to compute Range Tau.

I thought it was necessary for TCAS TA / RA. First, I just want to draw the custom symbols of the nearest traffic (no matter through polylines or bitmaps). Is it true that I need only my coordinates of the plane, the coordinates of traffic, bearing and the distance from it? Also scale for zoom map. I tried to do this as an example of fp waypoints, but it does not work.
 
Is it true that I need only my coordinates of the plane, the coordinates of traffic, bearing and the distance from it? Also scale for zoom map. I tried to do this as an example of fp waypoints, but it does not work.

Yes, that is all you need to make an an XML overlay of AI traffic using your own symbols. The process is very similar to the flight plan waypoint overlay that you have. Keep working on it and you'll get it.

Bob
 
Guys, need your help again!
I have a new trouble. I try to add custom VOR (or NDB, or airport) symbols on map. Ed tried to help me, but we failed. VOR symbol stay at one plece. I don't understand what the problem? Maybe with shift, or maybe bearing and distance to VOR not work correct in P3D, or we need to use any other GPS variable?
Here is a code:
Code:
 <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="No">
               (L:map NDzoom,number) 0 == if{
                14 (&gt;L:map NDzoom,number)
                4 (&gt;L:NDZoomfactor,number)
                }

(A:GPS POSITION LAT,radians) (>@c:NearestNdbCurrentLatitude,radians) (A:GPS POSITION LON,radians) (>@c:NearestNdbCurrentLongitude,radians) 8 (>@c:NearestNdbMaximumItems) 360 (>@c:NearestNdbMaximumDistance,kilometers)
(A:GPS POSITION LAT,radians) (>@c:NearestVorCurrentLatitude,radians) (A:GPS POSITION LON,radians) (>@c:NearestVorCurrentLongitude,radians) 8 (>@c:NearestVorMaximumItems) 360 (>@c:NearestVorMaximumDistance,kilometers)
(A:GPS POSITION LAT,radians) (>@c:NearestAirportCurrentLatitude,radians) (A:GPS POSITION LON,radians) (>@c:NearestAirportCurrentLongitude,radians) 20 (>@c:NearestAirportMaximumItems) 360 (>@c:NearestAirportMaximumDistance,kilometers)
(A:GPS POSITION LAT,radians) (>@c:NearestIntersectionCurrentLatitude,radians) (A:GPS POSITION LON,radians) (>@c:NearestIntersectionCurrentLongitude,radians) 8 (>@c:NearestIntersectionMaximumItems) 360 (>@c:NearestIntersectionMaximumDistance,kilometers)

 </Update>
 
 <Element>
<Position X="0" Y="0"/>
<MaskImage Name="KINO_MASK.bmp" ImageSizes="299,299">
            </MaskImage>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s2 0 !=)%{if}%(0 sp1)%{loop}%(l1 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
<!--
%((@c:NearestVorCurrentTrueBearing,degrees) (A:GPS MAGVAR,degrees) - d360)%!03d! &#xB0;M\n
%((@c:NearestVorCurrentDistance,kilometers))%!.1f! NM\n
-->
%{end}
%((@c:NearestVorCurrentDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor1,kilometers)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees))
</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Shift>
<Value>
(L:Bearingvor1,kilometers) (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,kilometers) - sin (L:Distancevor1,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>

</Element>
<Element>
<Polygon
Color="dodgerblue"
Bright="Yes">
<Point     X="-4"  Y="-7"/>
<Point     X="-9"  Y="-10"/>
<Point     X="-13"  Y="-3"/>
<Point     X="-6"  Y="1"/>
<Point     X="-4"  Y="-6"/>
<Point     X="4"  Y="-7"/>
<Point     X="9"  Y="-10"/>
<Point     X="13"  Y="-3"/>
<Point     X="6"  Y="1"/>
<Point     X="4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
<Point     X= "4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "3"  Y="11"/>
<Point     X= "-4"  Y="11"/>
<Point     X= "-4"  Y="6"/>
<Point     X= "4"  Y="6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
</Polygon>
<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>
</Element>

<Element>
<Position X="0" Y="0"/>
<MaskImage Name="KINO_MASK.bmp" ImageSizes="299,299">
            </MaskImage>
<FormattedText X="25" Y="8" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="right" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s2 0 !=)%{if}%(1 sp1)%{loop}%(l1 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
<!--
%((@c:NearestVorCurrentTrueBearing,degrees) (A:GPS MAGVAR,degrees) - d360)%!03d! &#xB0;M\n
%((@c:NearestVorCurrentDistance,kilometers))%!.1f! NM\n
-->
%{end}
%((@c:NearestVorCurrentDistance,kilometers) (L:NDZoomfactor,number) * (>L:Distancevor2,kilometers)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor2,degrees))
</String>
<Axis X="30" Y="12"/>
</FormattedText>
<Shift>
<Value>
(L:Bearingvor1,kilometers) (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:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,kilometers) - sin (L:Distancevor2,kilometers) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>

</Element>
<Element>
<Polygon
Color="dodgerblue"
Bright="Yes">
<Point     X="-4"  Y="-7"/>
<Point     X="-9"  Y="-10"/>
<Point     X="-13"  Y="-3"/>
<Point     X="-6"  Y="1"/>
<Point     X="-4"  Y="-6"/>
<Point     X="4"  Y="-7"/>
<Point     X="9"  Y="-10"/>
<Point     X="13"  Y="-3"/>
<Point     X="6"  Y="1"/>
<Point     X="4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
<Point     X= "4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "3"  Y="11"/>
<Point     X= "-4"  Y="11"/>
<Point     X= "-4"  Y="6"/>
<Point     X= "4"  Y="6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
</Polygon>
<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>
</Element>
2018-12-4_20-53-18-337.jpg
 
You did several times

Code:
(L:Bearingvor1,kilometers) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,kilometers) * -1 *
kilometers - radians . Be careful with proper units.


A few time times you wrote

Code:
(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,kilometers) *

That's correct.
 
You did several times

Code:
(L:Bearingvor1,kilometers) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor1,kilometers) * -1 *
kilometers - radians . Be careful with proper units.


A few time times you wrote

Code:
(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,kilometers) *

That's correct.

Multiply by -1 give us normal heading to object. Because bearing give reverse by 180 degrees from plane heading.
 
Code:
(L:Bearingvor1,kilometers) (A:PLANE HEADING DEGREES TRUE,radians) -
Try correcting this.
And maybe you should use a debug gauge to check the values you get.
 
Try correcting this.
And maybe you should use a debug gauge to check the values you get.

Oh, thank you so much! Sorry, it was my mistake. For example I tried early (last version) but it don't working too.


Code:
<!-- КУРС Mode-->
<Element>
  <Visible>(L:MFD SWITCH, enum) 2 ==</Visible>
  <Position X="0" Y="0"/>
   <Image Name="KINO_KURS_Background.bmp" Bright="Yes" ImageSizes="299,299"/>
   <Update Frequency="18"/>

<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:PLANE LATITUDE, RADIANS) (>L:Reference Latitude, radians) <!-- Whatever reference Latitude is desired -->
     (A:PLANE LONGITUDE, RADIANS) (>L:Reference Longitude, radians) <!-- Whatever reference Longitude is desired -->
     (L:Reference Latitude, radians) (>C:ITrafficInfo:Latitude, radians)
     (L:Reference Longitude, radians) (>C:ITrafficInfo:Longitude, radians)
     60 (>C:ITrafficInfo:Radius, nmiles)
     23 (>C:ITrafficInfo:MaxVehicles)
     80 (>C:ITrafficInfo:Filter)

     (A:PLANE LATITUDE, degrees) (>C:fs9gps:GeoCalcLatitude1, degrees)
     (A:PLANE LONGITUDE, degrees) (>C:fs9gps:GeoCalcLongitude1, degrees)
     (C:ITrafficInfo:S:PLANE LATITUDE, degrees) (>C:fs9gps:GeoCalcLatitude2, degrees)
     (C:ITrafficInfo:S:PLANE LONGITUDE, degrees) (>C:fs9gps:GeoCalcLongitude2, degrees)

(A:PLANE LATITUDE,Radians) (>@c:NearestNdbCurrentLatitude,Radians) (A:PLANE LONGITUDE,Radians) (>@c:NearestNdbCurrentLongitude,Radians) 8 (>@c:NearestNdbMaximumItems) 200 (>@c:NearestNdbMaximumDistance,NMiles)
(A:PLANE LATITUDE,Radians) (>@c:NearestVorCurrentLatitude,Radians) (A:PLANE LONGITUDE,Radians) (>@c:NearestVorCurrentLongitude,Radians) 8 (>@c:NearestVorMaximumItems) 200 (>@c:NearestVorMaximumDistance,NMiles)
(A:PLANE LATITUDE, Radians) (>@c:NearestAirportCurrentLatitude,Radians) (A:PLANE LONGITUDE,Radians) (>@c:NearestAirportCurrentLongitude,Radians) 20 (>@c:NearestAirportMaximumItems) 200 (>@c:NearestAirportMaximumDistance,NMiles)
(A:PLANE LATITUDE, Radians) (>@c:NearestIntersectionCurrentLatitude,Radians) (A:PLANE LONGITUDE,Radians) (>@c:NearestIntersectionCurrentLongitude,Radians) 8 (>@c:NearestIntersectionMaximumItems) 200 (>@c:NearestIntersectionMaximumDistance,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>
                <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>

<Element>
<Visible>(L:ND_VOR,bool)</Visible>
<Element>
<Position X="0" Y="0"/>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s2 0 !=)%{if}%(0 sp1)%{loop}%(l1 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
<!--
%((@c:NearestVorCurrentTrueBearing,degrees) (A:GPS MAGVAR, degrees) - d360)%!03d! &#xB0;M\n
%((@c:NearestVorCurrentDistance,nmiles))%!.1f! NM\n
-->
%{end}
%((@c:NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor1,nmiles)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor1,degrees))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<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>

</Element>
<Element>
<Position X="0" Y="0"/>
<Polygon
Color="#41A3FF"
Bright="Yes">
<Point     X="-4"  Y="-7"/>
<Point     X="-9"  Y="-10"/>
<Point     X="-13"  Y="-3"/>
<Point     X="-6"  Y="1"/>
<Point     X="-4"  Y="-6"/>
<Point     X="4"  Y="-7"/>
<Point     X="9"  Y="-10"/>
<Point     X="13"  Y="-3"/>
<Point     X="6"  Y="1"/>
<Point     X="4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
<Point     X= "4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "3"  Y="11"/>
<Point     X= "-4"  Y="11"/>
<Point     X= "-4"  Y="6"/>
<Point     X= "4"  Y="6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
</Polygon>
<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>
</Element>



<Element>
<Position X="0" Y="0"/>
<FormattedText X="55" Y="40" Bright="Yes" FontSize="9" Font="Tu2X4_VSS" LineSpacing="8"  Adjust="left" Color="dodgerblue" VerticalAdjust="Center">
<String>
%((@c:NearestVorItemsNumber) s2 0 !=)%{if}%(1 sp1)%{loop}%(l1 (>@c:NearestVorCurrentLine))
%((@c:NearestVorCurrentIdent))%!s!\n
<!--
%((@c:NearestVorCurrentTrueBearing,degrees) (A:GPS MAGVAR, degrees) - d360)%!03d! &#xB0;M\n
%((@c:NearestVorCurrentDistance,nmiles))%!.1f! NM\n
-->
%{end}
%((@c:NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor2,nmiles)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor2,degrees))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,nmiles) * -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,nmiles) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
</Element>

<Element>
<Position X="0" Y="0"/>
<Polygon
Color="#41A3FF"
Bright="Yes">
<Point     X="-4"  Y="-7"/>
<Point     X="-9"  Y="-10"/>
<Point     X="-13"  Y="-3"/>
<Point     X="-6"  Y="1"/>
<Point     X="-4"  Y="-6"/>
<Point     X="4"  Y="-7"/>
<Point     X="9"  Y="-10"/>
<Point     X="13"  Y="-3"/>
<Point     X="6"  Y="1"/>
<Point     X="4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
<Point     X= "4"  Y="-6"/>
<Point     X="-4"  Y="-6"/>
<Point     X="-6"  Y= "0"/>
<Point     X="-4"  Y= "6"/>
<Point     X= "4"  Y= "6"/>
<Point     X= "3"  Y="11"/>
<Point     X= "-4"  Y="11"/>
<Point     X= "-4"  Y="6"/>
<Point     X= "4"  Y="6"/>
<Point     X= "6"  Y= "0"/>
<Point     X= "4"  Y="-6"/>
</Polygon>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,nmiles) * -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,nmiles) * </Value>
<Nonlinearity>
<Item Value="-28" X=   "0"/>
<Item Value=   "0" X="150"/>
<Item Value= "28" X="300"/>
</Nonlinearity>
</Shift>
</Element>

Regards, Alexey.
 
Code:
%{end}
%((@c:NearestVorCurrentDistance,nmiles) (L:NDZoomfactor,number) * (>L:Distancevor2,nmiles)
(@c:NearestVorCurrentTrueBearing,degrees) (>L:Bearingvor2,degrees))
</String>
<Axis X="-5" Y="28"/>
</FormattedText>
<Shift>
<Value>(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,nmiles) * -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,nmiles) * </Value>
<Nonlinearity>

No idea if can you use formattext and shift in one element. I would say no.
I always separate them.

Code:
      <Element>
      <Position X="210" Y="217"/>
      <Polygon Color="darkorange" FillColor="darkorange" LineWidth="1" Luminous="Yes">
        <Point X="0" Y="-4"/>
        <Point X="0" Y="0"/>
        <Point X="1" Y="0"/>
        <Point X="0" Y="4"/>
        <Point X="-1" Y="0"/>
        <Point X="0" Y="0"/>
      </Polygon>
      <Rotate>
        <Value>(L:VOR_NearestAirportCurrentBearing,Radians) (A:PLANE HEADING DEGREES MAGNETIC,radians) - pi + </Value>
      </Rotate>
      </Element>


Code:
(L:Bearingvor2,radians) (A:PLANE HEADING DEGREES TRUE,radians) - cos (L:Distancevor2,nmiles) * -1 *

Do you check this values in a gauges?
Would be very helpful.
 
Maybe you should check Bob's FSMAP-Guidebook , page 136.
Transforming Gauge Units (Mouse Click) to Lat/Lon Coordinates:
Determining Distance, Bearing, Latitude and Longitude from a Mouse Click

You have to do it in the other direction.
"Transforming distance and bearing into pixel position"
 
Last try
And the position of your VOR?

Code:
<Element>
<Position X="0" Y="0"/>
<Polygon
Color="#41A3FF"
Bright="Yes">
 
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!
2018-12-5_20-52-4-67.jpg2018-12-5_20-52-29-711.jpg2018-12-5_21-4-28-381.jpg

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?
 
Not much help! I found only this
Code:
(@c::NearestVorCurrentDistance,nmiles)

twice "::"
So you need someone with P3Dv4..

Btw did you test your code with an internet explorer (firefox, edge..)
 
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.
 
Back
Top