A passing test.
This commit is contained in:
@@ -1,14 +0,0 @@
|
|||||||
|
|
||||||
goog.provide('ol');
|
|
||||||
|
|
||||||
goog.require('ol.map');
|
|
||||||
goog.require('goog.dom');
|
|
||||||
|
|
||||||
var map;
|
|
||||||
ol.main = function() {
|
|
||||||
goog.dom.getElement('output').innerHTML = 'test';
|
|
||||||
map = ol.map().center([45, 5]);
|
|
||||||
};
|
|
||||||
|
|
||||||
window['main'] = ol.main;
|
|
||||||
goog.exportSymbol('map', map);
|
|
||||||
@@ -1,15 +1,11 @@
|
|||||||
{
|
{
|
||||||
"id": "main",
|
"id": "ol",
|
||||||
|
|
||||||
"inputs": "main.js",
|
"inputs": "src/ol.js",
|
||||||
"paths": [
|
"paths": [
|
||||||
"."
|
"."
|
||||||
],
|
],
|
||||||
|
|
||||||
"externs": [
|
|
||||||
"//google_maps_api_v3.js"
|
|
||||||
],
|
|
||||||
|
|
||||||
"define": {
|
"define": {
|
||||||
// "goog.dom.ASSUME_STANDARDS_MODE": true,
|
// "goog.dom.ASSUME_STANDARDS_MODE": true,
|
||||||
"goog.DEBUG": true
|
"goog.DEBUG": true
|
||||||
|
|||||||
+15
-10
@@ -15,20 +15,25 @@ ol.ProjectionLike;
|
|||||||
* @return {ol.Projection} Projection.
|
* @return {ol.Projection} Projection.
|
||||||
*/
|
*/
|
||||||
ol.projection = function(opt_arg){
|
ol.projection = function(opt_arg){
|
||||||
var code;
|
var code, units;
|
||||||
if (arguments.length == 1) {
|
if (arguments.length == 1 && goog.isDef(opt_arg)) {
|
||||||
if (opt_arg instanceof ol.Projection) {
|
if (opt_arg instanceof ol.Projection) {
|
||||||
return opt_arg;
|
return opt_arg;
|
||||||
}
|
}
|
||||||
else
|
else if (goog.isString(opt_arg)) {
|
||||||
if (goog.isString(arguments[0])) {
|
code = opt_arg;
|
||||||
code = arguments[0];
|
}
|
||||||
}
|
else if (goog.isObject(opt_arg)) {
|
||||||
else {
|
code = opt_arg['code'];
|
||||||
throw new Error('ol.projection');
|
units = opt_arg['units'];
|
||||||
}
|
}
|
||||||
|
else {
|
||||||
|
throw new Error('ol.projection');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return new ol.Projection(code);
|
var proj = new ol.Projection();
|
||||||
|
proj.setCode(code);
|
||||||
|
return proj;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,4 @@
|
|||||||
|
goog.provide("ol");
|
||||||
|
goog.require("ol.map");
|
||||||
|
goog.require("ol.loc");
|
||||||
|
goog.require("ol.projection");
|
||||||
+1
-4
@@ -9,10 +9,7 @@
|
|||||||
<script type="text/javascript" src="jasmine-1.2.0/jasmine-html.js"></script>
|
<script type="text/javascript" src="jasmine-1.2.0/jasmine-html.js"></script>
|
||||||
|
|
||||||
<!-- include source files here... -->
|
<!-- include source files here... -->
|
||||||
<script type="text/javascript" src="../src/ol/Bounds.js"></script>
|
<script type="text/javascript" src="http://localhost:9810/compile?id=ol&mode=RAW"></script>
|
||||||
<script type="text/javascript" src="../src/ol/Location.js"></script>
|
|
||||||
<script type="text/javascript" src="../src/ol/Map.js"></script>
|
|
||||||
<script type="text/javascript" src="../src/ol/Projection.js"></script>
|
|
||||||
|
|
||||||
<!-- include spec files here... -->
|
<!-- include spec files here... -->
|
||||||
<script type="text/javascript" src="spec/ol/Bounds.test.js"></script>
|
<script type="text/javascript" src="spec/ol/Bounds.test.js"></script>
|
||||||
|
|||||||
@@ -6,7 +6,10 @@ describe("ol.Projection", function() {
|
|||||||
p = ol.projection("foo");
|
p = ol.projection("foo");
|
||||||
expect(p.code()).toBe("foo");
|
expect(p.code()).toBe("foo");
|
||||||
|
|
||||||
p = ol.projection({code: "bar"});
|
p = ol.projection({
|
||||||
|
code: "bar",
|
||||||
|
units: "m"
|
||||||
|
});
|
||||||
expect(p.code()).toBe("bar");
|
expect(p.code()).toBe("bar");
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user