Skip to content

Commit c9756e3

Browse files
committed
Completed implementation of logo display. Modified CoordinatesDisplayLayer to accomodate logo
1 parent f628760 commit c9756e3

File tree

3 files changed

+16
-19
lines changed

3 files changed

+16
-19
lines changed

src/WorldWind.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,8 +1112,6 @@ define([ // PLEASE KEEP ALL THIS IN ALPHABETICAL ORDER BY MODULE NAME (not direc
11121112
* <li><code>baseUrl</code>: The URL of the directory containing the WorldWind Library and its resources.</li>
11131113
* <li><code>layerRetrievalQueueSize</code>: The number of concurrent tile requests allowed per layer. The default is 16.</li>
11141114
* <li><code>coverageRetrievalQueueSize</code>: The number of concurrent tile requests allowed per elevation coverage. The default is 16.</li>
1115-
* <li><code>worldWindLogoPlacement</code>: An {@link Offset} to place the official WorldWind logo. The default is a 7px margin inset from the upper left corner of the screen.</li>
1116-
* <li><code>worldWindLogoAlignment</code>: An {@link Offset} to align the WorldWind logo relative to its placement position. The default is the upper left corner of the logo.</li>
11171115
* <li><code>bingLogoPlacement</code>: An {@link Offset} to place a Bing logo attribution. The default is a 7px margin inset from the lower right corner of the screen.</li>
11181116
* <li><code>bingLogoAlignment</code>: An {@link Offset} to align the Bing logo relative to its placement position. The default is the lower right corner of the logo.</li>
11191117
* </ul>
@@ -1124,8 +1122,6 @@ define([ // PLEASE KEEP ALL THIS IN ALPHABETICAL ORDER BY MODULE NAME (not direc
11241122
baseUrl: (WWUtil.worldwindlibLocation()) || (WWUtil.currentUrlSansFilePart() + '/../'),
11251123
layerRetrievalQueueSize: 16,
11261124
coverageRetrievalQueueSize: 16,
1127-
worldWindLogoPlacement: new Offset(WorldWind.OFFSET_PIXELS, 7, WorldWind.OFFSET_INSET_PIXELS, 7),
1128-
worldWindLogoAlignment: new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1),
11291125
bingLogoPlacement: new Offset(WorldWind.OFFSET_INSET_PIXELS, 7, WorldWind.OFFSET_PIXELS, 7),
11301126
bingLogoAlignment: new Offset(WorldWind.OFFSET_FRACTION, 1, WorldWind.OFFSET_FRACTION, 0)
11311127
};

src/layer/CoordinatesDisplayLayer.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -163,14 +163,14 @@ define([
163163
y = 11;
164164
yUnitsScreen = WorldWind.OFFSET_PIXELS;
165165
yUnitsText = 0;
166-
} else if (canvasWidth > 400) { // medium canvas, align the text in the top left
167-
x = 60;
168-
y = 5;
166+
} else if (canvasWidth > 400) { // medium canvas, align the text in the top left, below the logo
167+
x = 64;
168+
y = 33;
169169
yUnitsScreen = WorldWind.OFFSET_INSET_PIXELS;
170170
yUnitsText = 1;
171-
} else { // small canvas, suppress the eye altitude, align the text in the top left and suppress eye alt
172-
x = 60;
173-
y = 5;
171+
} else { // small canvas, suppress the eye altitude, align the text in the top left, below the logo, and suppress eye alt
172+
x = 64;
173+
y = 33;
174174
yUnitsScreen = WorldWind.OFFSET_INSET_PIXELS;
175175
yUnitsText = 1;
176176
hideEyeAlt = true;

src/shapes/WorldWindLogo.js

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -55,30 +55,31 @@ function (ArgumentError,
5555
var WorldWindLogo = function (screenOffset, imagePath) {
5656

5757
var sOffset = screenOffset ? screenOffset
58-
: new Offset(WorldWind.configuration.worldWindLogoAlignment),
58+
: new Offset(WorldWind.OFFSET_FRACTION, 0, WorldWind.OFFSET_FRACTION, 1),
5959
iPath = imagePath ? imagePath : WorldWind.configuration.baseUrl + "images/worldwind-logo.png";
60+
console.log(WorldWind.configuration.worldWindLogoPlacement);
6061

6162
ScreenImage.call(this, sOffset, iPath);
6263

6364
// Must set the configured image offset after calling the constructor above.
6465

6566
if (!screenOffset) {
66-
this.imageOffset = new Offset(WorldWind.configuration.worldWindLogoAlignment);
67+
this.imageOffset = new Offset(WorldWind.OFFSET_PIXELS, -7, WorldWind.OFFSET_INSET_PIXELS, -7);
6768
}
6869
};
6970

7071
WorldWindLogo.prototype = Object.create(ScreenImage.prototype);
7172

7273
WorldWindLogo.prototype.render = function (dc) {
7374

74-
// // Capture the navigator's heading and tilt and apply it to the compass' screen image.
75-
// this.imageRotation = dc.navigator.heading;
76-
// this.imageTilt = dc.navigator.tilt;
75+
// Capture the navigator's heading and tilt and apply it to the compass' screen image.
76+
this.imageRotation = dc.navigator.heading;
77+
this.imageTilt = dc.navigator.tilt;
7778

78-
// var t = this.getActiveTexture(dc);
79-
// if (t) {
80-
// this.imageScale = this.size * dc.currentGlContext.drawingBufferWidth / t.imageWidth;
81-
// }
79+
var t = this.getActiveTexture(dc);
80+
if (t) {
81+
this.imageScale = 1.0;
82+
}
8283

8384
ScreenImage.prototype.render.call(this, dc);
8485
};

0 commit comments

Comments
 (0)