123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272 |
- define([
- '../Core/Color',
- '../Core/defaultValue',
- '../Core/defined',
- '../Core/defineProperties',
- '../Core/Event',
- '../Core/GeographicTilingScheme'
- ], function(
- Color,
- defaultValue,
- defined,
- defineProperties,
- Event,
- GeographicTilingScheme) {
- "use strict";
-
- var TileCoordinatesImageryProvider = function TileCoordinatesImageryProvider(options) {
- options = defaultValue(options, defaultValue.EMPTY_OBJECT);
- this._tilingScheme = defined(options.tilingScheme) ? options.tilingScheme : new GeographicTilingScheme();
- this._color = defaultValue(options.color, Color.YELLOW);
- this._errorEvent = new Event();
- this._tileWidth = defaultValue(options.tileWidth, 256);
- this._tileHeight = defaultValue(options.tileHeight, 256);
- };
- defineProperties(TileCoordinatesImageryProvider.prototype, {
-
- proxy : {
- get : function() {
- return undefined;
- }
- },
-
- tileWidth : {
- get : function() {
- return this._tileWidth;
- }
- },
-
- tileHeight: {
- get : function() {
- return this._tileHeight;
- }
- },
-
- maximumLevel : {
- get : function() {
- return undefined;
- }
- },
-
- minimumLevel : {
- get : function() {
- return undefined;
- }
- },
-
- tilingScheme : {
- get : function() {
- return this._tilingScheme;
- }
- },
-
- rectangle : {
- get : function() {
- return this._tilingScheme.rectangle;
- }
- },
-
- tileDiscardPolicy : {
- get : function() {
- return undefined;
- }
- },
-
- errorEvent : {
- get : function() {
- return this._errorEvent;
- }
- },
-
- ready : {
- get : function() {
- return true;
- }
- },
-
- credit : {
- get : function() {
- return undefined;
- }
- },
-
- hasAlphaChannel : {
- get : function() {
- return true;
- }
- }
- });
-
- TileCoordinatesImageryProvider.prototype.getTileCredits = function(x, y, level) {
- return undefined;
- };
-
- TileCoordinatesImageryProvider.prototype.requestImage = function(x, y, level) {
- var canvas = document.createElement('canvas');
- canvas.width = 256;
- canvas.height = 256;
- var context = canvas.getContext('2d');
- var cssColor = this._color.toCssColorString();
- context.strokeStyle = cssColor;
- context.lineWidth = 2;
- context.strokeRect(1, 1, 255, 255);
- var label = 'L' + level + 'X' + x + 'Y' + y;
- context.font = 'bold 25px Arial';
- context.textAlign = 'center';
- context.fillStyle = 'black';
- context.fillText(label, 127, 127);
- context.fillStyle = cssColor;
- context.fillText(label, 124, 124);
- return canvas;
- };
-
- TileCoordinatesImageryProvider.prototype.pickFeatures = function() {
- return undefined;
- };
- return TileCoordinatesImageryProvider;
- });
|