@@ -24,16 +24,24 @@ define([
24
24
var minimumBuffer = 0.000001 ;
25
25
26
26
function convertToValid ( key , model ) {
27
- if ( key . mapSouth !== undefined && ( key . mapSouth >= key . mapNorth || key . mapSouth >= model . get ( 'mapNorth' ) ) ) {
27
+ if ( key . mapSouth !== undefined &&
28
+ ( key . mapSouth >= key . mapNorth ||
29
+ ( ! key . mapNorth && key . mapSouth >= model . get ( 'mapNorth' ) ) ) ) {
28
30
key . mapSouth = parseFloat ( ( key . mapNorth || model . get ( 'mapNorth' ) ) ) - minimumDifference ;
29
31
}
30
- if ( key . mapEast !== undefined && ( key . mapEast <= key . mapWest || key . mapEast <= model . get ( 'mapWest' ) ) ) {
32
+ if ( key . mapEast !== undefined &&
33
+ ( key . mapEast <= key . mapWest ||
34
+ ( ! key . mapWest && key . mapEast <= model . get ( 'mapWest' ) ) ) ) {
31
35
key . mapEast = parseFloat ( ( key . mapWest || model . get ( 'mapWest' ) ) ) + minimumDifference ;
32
36
}
33
- if ( key . mapWest !== undefined && ( key . mapWest >= key . mapEast || key . mapWest >= model . get ( 'mapEast' ) ) ) {
37
+ if ( key . mapWest !== undefined &&
38
+ ( key . mapWest >= key . mapEast ||
39
+ ( ! key . mapEast && key . mapWest >= model . get ( 'mapEast' ) ) ) ) {
34
40
key . mapWest = parseFloat ( ( key . mapEast || model . get ( 'mapEast' ) ) ) - minimumDifference ;
35
41
}
36
- if ( key . mapNorth !== undefined && ( key . mapNorth <= key . mapSouth || key . mapNorth <= model . get ( 'mapSouth' ) ) ) {
42
+ if ( key . mapNorth !== undefined &&
43
+ ( key . mapNorth <= key . mapSouth ||
44
+ ( ! key . mapSouth && key . mapNorth <= model . get ( 'mapSouth' ) ) ) ) {
37
45
key . mapNorth = parseFloat ( ( key . mapSouth || model . get ( 'mapSouth' ) ) ) + minimumDifference ;
38
46
}
39
47
if ( key . mapNorth !== undefined ) {
@@ -144,16 +152,18 @@ define([
144
152
} ,
145
153
146
154
setLatLon : function ( ) {
147
- var result = { } ;
148
- result . north = this . get ( 'mapNorth' ) ;
149
- result . south = this . get ( 'mapSouth' ) ;
150
- result . west = this . get ( 'mapWest' ) ;
151
- result . east = this . get ( 'mapEast' ) ;
152
- if ( ! ( result . north && result . south && result . west && result . east ) ) {
153
- result = converter . USNGtoLL ( this . get ( 'usngbb' ) ) ;
155
+ if ( this . get ( 'locationType' ) === "latlon" ) {
156
+ var result = { } ;
157
+ result . north = this . get ( 'mapNorth' ) ;
158
+ result . south = this . get ( 'mapSouth' ) ;
159
+ result . west = this . get ( 'mapWest' ) ;
160
+ result . east = this . get ( 'mapEast' ) ;
161
+ if ( ! ( result . north && result . south && result . west && result . east ) ) {
162
+ result = converter . USNGtoLL ( this . get ( 'usngbb' ) ) ;
154
163
164
+ }
165
+ this . set ( result ) ;
155
166
}
156
- this . set ( result ) ;
157
167
} ,
158
168
159
169
setFilterBBox : function ( model ) {
0 commit comments