Skip to content

Commit 8924db0

Browse files
committed
Added help text to README.md
1 parent 0a1ecca commit 8924db0

1 file changed

Lines changed: 24 additions & 23 deletions

File tree

README.md

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ territoryAlphaCode | string, full territory alphacode
6868

6969
The most widely used routine to generate mapcodes is probably:
7070

71-
encodeShortest (lat, lon, territory)
71+
encodeShortest(lat, lon, territory)
7272

7373
parameter | description
7474
--- | ---
@@ -84,14 +84,15 @@ sometimes called the “default mapcode” for a particular territory.
8484
Example Javascript:
8585

8686
function displayMapcodes(e) {
87-
document.write('<u>',e.length,' result(s)</u><br>');
88-
for(var i=0;i<e.length;i++) {
89-
if ( e[i].territoryAlphaCode != "AAA" )
90-
document.write(e[i].territoryAlphaCode,' ');
91-
document.write('<b>',e[i].mapcode,'</b><br>');
87+
document.write('<u>',e.length,' result(s)</u><br/>');
88+
for(var i = 0; i < e.length; i++) {
89+
if (e[i].territoryAlphaCode != "AAA") {
90+
document.write(e[i].territoryAlphaCode, ' ');
91+
}
92+
document.write('<b>', e[i].mapcode, '</b><br/>');
9293
}
9394
}
94-
displayMapcodes( encodeShortest( 34.00956,-118.210572, 'US-CA' ) );
95+
displayMapcodes(encodeShortest(34.00956, -118.210572, 'US-CA'));
9596

9697
Output:
9798

@@ -106,7 +107,7 @@ Since any coordinate is somewhere on the world, this routine is guaranteed to de
106107

107108
Example Javascript:
108109

109-
var e = encodeShortest( 34.00956,-118.210572 );
110+
var e = encodeShortest(34.00956, -118.210572);
110111

111112
Output using displayMapcodes(e):
112113

@@ -133,7 +134,7 @@ will simply yield all mapcodes that can represent the coordinate.
133134

134135
Example Javascript:
135136

136-
var e = encode( 36.115, -115.1731, 'US-NV' );
137+
var e = encode(36.115, -115.1731, 'US-NV');
137138

138139
Output using `displayMapcodes(e)`:
139140

@@ -150,7 +151,7 @@ country share. Of course, the shortest mapcode is preferred in almost every circ
150151

151152
Example Javascript:
152153

153-
var e = encode( 36.115, -115.1731 );
154+
var e = encode(36.115, -115.1731);
154155

155156
Output using `displayMapcodes(e)`:
156157

@@ -173,7 +174,7 @@ mapcodes correctly represent the original coordinate.
173174

174175
For very specific applications, the following routine only returns the international mapcode
175176

176-
encodeInternational (lat, lon)
177+
encodeInternational(lat, lon)
177178

178179
returns an array with exactly one result: the 9-letter international mapcode representing
179180
the coordinate.
@@ -215,8 +216,8 @@ This routine is sufficient to decode a full mapcodeString into a coordinate.
215216

216217
Example Javascript:
217218

218-
var result = decode( 'NLD 49.4V' );
219-
document.write( result.y + ',' + result.x + '<BR>' );
219+
var result = decode('NLD 49.4V');
220+
document.write(result.y + ',' + result.x + '<br/>');
220221

221222
Output:
222223

@@ -247,14 +248,14 @@ Example Javascript:
247248
var defaultcontext = 'IN-DL';
248249

249250
var result;
250-
result = decode( 'US-AR 49.4V', defaultcontext );
251-
document.write( result.y + ',' + result.x + '<BR>' );
252-
result = decode( 'AR 49.4V', defaultcontext );
253-
document.write( result.y + ',' + result.x + '<BR>' );
254-
result = decode( '49.4V', defaultcontext );
255-
document.write( result.y + ',' + result.x + '<BR>' );
256-
result = decode( 'xxx.xxxx', defaultcontext );
257-
document.write( result.y + ',' + result.x + '<BR>' );
251+
result = decode('US-AR 49.4V', defaultcontext);
252+
document.write(result.y + ',' + result.x + '<br/>');
253+
result = decode('AR 49.4V', defaultcontext);
254+
document.write(result.y + ',' + result.x + '<br/>');
255+
result = decode('49.4V', defaultcontext);
256+
document.write(result.y + ',' + result.x + '<br/>');
257+
result = decode('xxx.xxxx', defaultcontext);
258+
document.write(result.y + ',' + result.x + '<br/>');
258259

259260
Output:
260261

@@ -344,8 +345,8 @@ return value | a string
344345

345346
Example Javascript:
346347

347-
document.write(convertToAlphabetAsHTML( ‘PQ.RS’, 4 ) ,’<br>’)
348-
document.write(convertToAlphabetAsHTML( ‘PQ.RS’, 2 ) ,’<br>’)
348+
document.write(convertToAlphabetAsHTML(‘PQ.RS’, 4) ,’<br/>’)
349+
document.write(convertToAlphabetAsHTML(‘PQ.RS’, 2) ,’<br/>’)
349350

350351
Output:
351352

0 commit comments

Comments
 (0)