You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Tries to parse from a string where the longitude appears before the latitude.
181
185
182
186
**Parameters**
183
187
184
188
-`str`**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** A string in the format: `longitude,latitude`
185
-
-`latIsFirst`**[boolean](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not the first value is latitude. (optional, default `false`)
186
189
187
190
**Examples**
188
191
189
192
```javascript
190
193
var lonlat =require('@conveyal/lonlat')
191
194
192
-
var position =lonlat.fromString('12,34') // { lon: 12, lat: 34 }
193
-
var position =lonlat.fromString('12,34', true) // { lon: 34, lat: 12 }
195
+
var position =lonlat.fromString('12,34') // { lon: 12, lat: 34 }
196
+
var position =lonlat.fromLonFirstString('12,34') // { lon: 12, lat: 34 }
Tries to parse from a string where the latitude appears before the longitude.
206
+
207
+
**Parameters**
208
+
209
+
-`str`**[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** A string in the format: `latitude,longitude`
210
+
211
+
**Examples**
212
+
213
+
```javascript
214
+
var lonlat =require('@conveyal/lonlat')
215
+
216
+
var position =lonlat.fromLatFirstString('12,34) // { lon: 34, lat: 12 }
Returns **[string](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String)** A string in the format 'longitude,latitude'
350
+
351
+
#### toLatFirstString
352
+
353
+
Translates to coordinate string where the latitude appears before longitude.
308
354
309
355
**Parameters**
310
356
@@ -315,7 +361,7 @@ Translates to coordinate string.
315
361
```javascript
316
362
var lonlat = require('@conveyal/lonlat')
317
363
318
-
var str =lonlat.toString({ lat:12, longitude:34 }) // '34,12'
0 commit comments