Export and externalize Control.setMap

This commit is contained in:
Éric Lemoine
2013-03-28 11:21:10 +01:00
parent 2944b31c69
commit 7a71f107cb
10 changed files with 40 additions and 13 deletions

View File

@@ -309,6 +309,7 @@ def examples_star_json(name, match):
'../externs/bingmaps.js',
'../externs/bootstrap.js',
'../externs/geojson.js',
'../externs/oli.js',
'../externs/proj4js.js',
'../externs/tilejson.js',
],

View File

@@ -42,6 +42,7 @@
"//json.js",
"../externs/bingmaps.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js"
],

View File

@@ -7,6 +7,7 @@
"../build/src/external/externs/types.js",
"../externs/bingmaps.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js"
],

View File

@@ -16,6 +16,7 @@
"//json.js",
"../externs/bingmaps.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js"
],

View File

@@ -17,6 +17,7 @@
"//json.js",
"../externs/bingmaps.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js"
],

View File

@@ -17,6 +17,7 @@
"../build/src/external/externs/types.js",
"../externs/bingmaps.js",
"../externs/geojson.js",
"../externs/oli.js",
"../externs/proj4js.js",
"../externs/tilejson.js"
],

21
externs/oli.js Normal file
View File

@@ -0,0 +1,21 @@
/**
* @externs
*/
/**
* @type {Object}
*/
var oli;
/**
* @interface
*/
oli.control.Control = function() {};
/**
* @param {ol.Map} map Map.
* @return {undefined} Undefined.
*/
oli.control.Control.prototype.setMap = function(map) {};

View File

@@ -109,6 +109,13 @@
* @property {Element|undefined} target Target.
*/
/**
* @typedef {Object} ol.control.ControlOptions
* @property {Element|undefined} element Element.
* @property {ol.Map|undefined} map Map.
* @property {Element|undefined} target Target.
*/
/**
* @typedef {Object} ol.control.DefaultsOptions
* @property {boolean|undefined} attribution Attribution.

View File

@@ -0,0 +1,2 @@
@exportClass ol.control.Control ol.control.ControlOptions
@exportProperty ol.control.Control.prototype.setMap

View File

@@ -1,5 +1,4 @@
goog.provide('ol.control.Control');
goog.provide('ol.control.ControlOptions');
goog.require('goog.Disposable');
goog.require('goog.array');
@@ -8,14 +7,6 @@ goog.require('goog.events');
goog.require('ol.MapEventType');
/**
* @typedef {{element: (Element|undefined),
* map: (ol.Map|undefined),
* target: (Element|undefined)}}
*/
ol.control.ControlOptions;
/**
* A thing which is painted over the map to provide a means for interaction
@@ -23,6 +14,7 @@ ol.control.ControlOptions;
*
* @constructor
* @extends {goog.Disposable}
* @implements {oli.control.Control}
* @param {ol.control.ControlOptions} options Control options.
*/
ol.control.Control = function(options) {
@@ -85,10 +77,9 @@ ol.control.Control.prototype.handleMapPostrender = goog.nullFunction;
/**
* Removes the control from its current map and attaches it to the new map.
* Subtypes might also wish set up event handlers to get notified about changes
* to the map here.
*
* Remove the control from its current map and attach it to the new map.
* Subclasses may set up event handlers to get notified about changes to
* the map here.
* @param {ol.Map} map Map.
*/
ol.control.Control.prototype.setMap = function(map) {