High-Quality jQuery Flight Instrument Indicator Plugin Flight Indicats

Add-ons
2026-07-26 04:11 4 次浏览 • 0 次下载 36.3KB
High-Quality jQuery Flight Instrument Indicator Plugin Flight Indicats

Flight Indicats Plugin

The flight instrument types currently supported by this plugin include:

  • Artificial Horizon

  • Heading

  • Vertical Speed

  • Airspeed

  • Altimeter

Usage

To use this flight instrument indicator plugin, first include the required JS and CSS files.

1
2
3
4
5
<link rel="stylesheet" type="text/css" href="css/flightindicators.css" />
<!-- Importing jQuery library -->
<!-- Importing the FlightIndicators library -->
<script src="js/jquery.flightindicators.js"></script>

HTML Structure

You can use a <escape><span> element to contain an indicator.

1
<span id="attitude"></span>

Call the plugin

After the page has finished loading, you can initialize the flight instrument indicator plugin using the following method.

1
var indicator = $.flightIndicator('#attitude', type, options);

The first parameter is a jQuery selector, the type parameter specifies the indicator type, and the options parameter can override the default settings.

The simplest initialization method is as follows:

1
var indicator = $.flightIndicator('#attitude', 'attitude');

The indicator type can be:attitude、heading、variometer、airspeedoraltimeter. If the type parameter is not specified, the default indicator type will be used.

Configuration Parameters

The following are the default settings for this flight instrument indicator:

1
2
3
4
5
6
7
8
9
10
11
12
var options = {
size:200,// Set the pixel size of the indicator (square)
roll:0,// Roll angle of the attitude indicator (degrees)
pitch:0,// Pitch angle of the attitude indicator (degrees)
heading:0,// Heading angle of the heading indicator (degrees)
vario:0,// Vertical speed of the variometer indicator in thousands of feet per minute
airspeed: 0,// Airspeed of the airspeed indicator
altitude:0,// Altitude of the altimeter indicator
pressure:1000,// Pressure of the pressure gauge indicator in hPa
showBox:true,// Set whether the external square frame is visible (true or false)
img_directory:'img /'// Directory for saving images
}

All parameter options are optional.

Update Indicator Information

The plugin provides several methods for updating indicator information. Here is a simple example:

1
2
var attitude = $.flightIndicator('#attitude', 'attitude');
attitude.setRoll(30); // Sets the roll to 30 degrees

The following are all available methods.

  • indicator.setRoll(roll); // Set the roll of the attitude indicator

  • indicator.setPitch(pitch); // Set the pitch of the attitude indicator

  • indicator.setHeading(heading); // Set the heading of the heading indicator

  • indicator.setVario(vario); // Set the climb rate of the variometer indicator

  • indicator.setAirSpeed(speed); // Set the speed of the airspeed indicator

  • indicator.setAltitude(altitude); // Set the altitude of the altimeter indicator

  • indicator.setPressure(pressure); // Set the pressure of the altimeter indicator

  • indicator.resize(size); // Set the size of any indicator

  • indicator.showBox(); // Make the external square frame of any instrument visible

  • indicator.hideBox(); // Make the external square frame of any instrument invisible

星河码客

发现和分享优质开源项目,传承互联网精神,为开发者服务。

关于本站

联系我们

微信/广告合作:ITcloub (备注星河码客)

免责声明:本站资源版权归原作者所有,仅供学习与交流。如有侵权,请通过「关于我们 - 侵权投诉」联系删除。

Powered by Nuxt · Deployed on Cloudflare