codesite-noreply at google.com
2009-Sep-20 13:27 UTC
[Mapstraction] [mapstraction] r30 committed - jslint now passing for google and googlev3
Revision: 30
Author: freyfogle
Date: Sun Sep 20 06:26:44 2009
Log: jslint now passing for google and googlev3
http://code.google.com/p/mapstraction/source/detail?r=30
Modified:
/trunk/build.xml
/trunk/source/mxn.google.core.js
/trunk/source/mxn.googlev3.core.js
======================================--- /trunk/build.xml Sun Sep 20 06:13:41
2009
+++ /trunk/build.xml Sun Sep 20 06:26:44 2009
@@ -57,6 +57,14 @@
<arg value="tools/jslint/jslint.js"/>
<arg value="${build.dir}/mxn.core.js"/>
</java>
+ <java jar="tools/rhino/js.jar" fork="true"
failonerror="true">
+ <arg value="tools/jslint/jslint.js"/>
+ <arg value="${build.dir}/mxn.google.core.js"/>
+ </java>
+ <java jar="tools/rhino/js.jar" fork="true"
failonerror="true">
+ <arg value="tools/jslint/jslint.js"/>
+ <arg value="${build.dir}/mxn.googlev3.core.js"/>
+ </java>
<!-- document our sources -->
<echo>--- DOC ---</echo>
======================================--- /trunk/source/mxn.google.core.js Sun
Sep 20 04:50:06 2009
+++ /trunk/source/mxn.google.core.js Sun Sep 20 06:26:44 2009
@@ -83,9 +83,11 @@
// Google has a combined zoom and pan control.
if (args.zoom || args.pan) {
- (args.zoom == ''large'')
- ? this.addLargeControls()
- : this.addSmallControls();
+ if (args.zoom == ''large''){
+ this.addLargeControls();
+ } else {
+ this.addSmallControls();
+ }
}
if (args.scale) {
@@ -184,7 +186,7 @@
setCenter: function(point, options) {
var map = this.maps[this.api];
var pt = point.toProprietary(this.api);
- if(options && options[''pan'']) {
+ if(options && options.pan) {
map.panTo(pt);
}
else {
@@ -357,7 +359,7 @@
mousePosition: function(element) {
var locDisp = document.getElementById(element);
- if (locDisp != null) {
+ if (locDisp !== null) {
var map = this.maps[this.api];
GEvent.addListener(map, ''mousemove'', function (point) {
var loc = point.lat().toFixed(4) + '' / '' +
point.lng().toFixed(4);
@@ -496,11 +498,10 @@
gpoints.push(this.points[i].toProprietary(''google''));
}
if (this.closed || gpoints[0].equals(gpoints[length-1])) {
- var gpoly = new GPolygon(gpoints, this.color, this.width, this.opacity,
this.fillColor || "#5462E3", this.opacity || "0.3");
+ return new GPolygon(gpoints, this.color, this.width, this.opacity,
this.fillColor || "#5462E3", this.opacity || "0.3");
} else {
- var gpoly = new GPolyline(gpoints, this.color, this.width,
this.opacity);
- }
- return gpoly;
+ return new GPolyline(gpoints, this.color, this.width, this.opacity);
+ }
},
show: function() {
@@ -510,7 +511,6 @@
hide: function() {
throw ''Not implemented'';
}
-
}
});
======================================--- /trunk/source/mxn.googlev3.core.js Sun
Sep 20 06:07:56 2009
+++ /trunk/source/mxn.googlev3.core.js Sun Sep 20 06:26:44 2009
@@ -41,12 +41,14 @@
addControls: function( args ) {
var map = this.maps[this.api];
// remove old controls
+
// Google has a combined zoom and pan control.
if (args.zoom || args.pan) {
- (args.zoom == ''large'')
- ? this.addLargeControls()
- : this.addSmallControls();
-
+ if (args.zoom == ''large''){
+ this.addLargeControls();
+ } else {
+ this.addSmallControls();
+ }
}
},
@@ -66,7 +68,7 @@
var map = this.maps[this.api];
var myOptions = {
navigationControl:true,
- navigationControlOptions:
{style:google.maps.NavigationControlStyle.DEFAULT},
+ navigationControlOptions:
{style:google.maps.NavigationControlStyle.DEFAULT}
};
map.setOptions(myOptions);
this.addControlsArgs.pan = true;
@@ -77,7 +79,7 @@
var map = this.maps[this.api];
var myOptions = {
mapTypeControl: true,
- mapTypeControlOptions: {style:
google.maps.MapTypeControlStyle.DEFAULT},
+ mapTypeControlOptions: {style:
google.maps.MapTypeControlStyle.DEFAULT}
};
map.setOptions(myOptions);
this.addControlsArgs.map_type = true;
@@ -150,7 +152,7 @@
setCenter: function(point, options) {
var map = this.maps[this.api];
var pt = point.toProprietary(this.api);
- if(options && options[''pan'']) {
+ if(options && options.pan) {
// TODO: Add provider code
}
else {
@@ -205,7 +207,7 @@
getMapType: function() {
var map = this.maps[this.api];
- var type = map.getMapTypeId()
+ var type = map.getMapTypeId();
switch(type) {
case google.maps.MapTypeId.ROADMAP:
return mxn.Mapstraction.ROAD;
Possibly Parallel Threads
- r34 committed - removed deprecated method draggable, all controls off when first creat...
- [mapstraction commit] r12 - Implemented most Cloudmade functions. Still requires image, tile and KML/GeoRSS overlays
- JSLint
- r83 committed - Making the geocoder pass JSLint
- jslint and carriage returns
