Copyright (C) 2014-2015 Stichting Mapcode Foundation (http://www.mapcode.com)
Online documentation can be found at: http://mapcode-foundation.github.io/mapcode-js/
If you plan to use mapcodes in HTML/Javascript extensively, you may be interested in looking at running an instance of a Mapcode REST API server in your applications landscape.
This reduces the payload the HTML/Javascript tremendously, as the mapcode tables will not need to be transported to the client.
You can find the Mapcode REST API sources, ready to be deployed on any JVM server, like Tomcat or Jetty, on: https://github.com/mapcode-foundation/mapcode-rest-service
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Original C library created by Pieter Geelen. Work on Java version of the Mapcode library by Rijn Buve and Matthew Lowden.
The following files provide the Javascript interfaces for mapcodes:
mapcode.js - Key routines for mapcode support
ndata.js - Data table for mapcode support
sample.html - Sample code to interpret / generate mapcodes
ctrynams.js - Optional js array with the names of territories (in English)
To run the Javascript unit tests, simply open the file unittest/unittest/html
.
-
Added scripts for Korean (Choson'gul / Hangul), Burmese, Khmer, Sinhalese, Thaana (Maldivan), Chinese (Zhuyin, Bopomofo), Tifinagh (Berber), Tamil, Amharic, Telugu, Odia, Kannada, Gujarati.
-
Renamed language strings to more correct terms (Malay to Malayalam; Hindi to Devanagari).
-
Added var
alphabetsForTerritory[t]
, returning the most commonly used alphabets for territoryt
. -
Improved some characters for Arabic and Devanagari.
-
Fixed Bengali to also support Assamese.
-
For some alphabets, removed recognition of letters
I
and/orO
unless looking like digits1
and/or0
. -
Replaced internal encoded
entity_iso[]
array by non-encodediso3166alpha[]
.
-
Minor fixes to prevent some compiler warnings, or multiple inclusion of
.h
files. -
Minor data fix (
ndata.js
) for Gansu Province, China (where mountain range extending further west).
-
Arabic script added.
-
Tibetan script changed so all characters can be typed on a computer keyboard without using the SHIFT key.
-
Greek, Hebrew and Arabic, the scripts that have (implied) vowels in mapcode sequences, have been extended with ABJAD conversion, to prevent more than two consecutive non-digits from occurring.
-
NOTE: as a result, mapcodes in Greek, Arab and Hebrew scripts are now often one character longer than in the roman script.
-
Solved 1-microdegree gap in a few spots on Earth, noticable now extreme precision is possible;
-
Ran source through code prettifier
-
Added maxErrorInMeters to API;
-
Enforce
encode(decode(m)) == m
except near territory borders -
Stricter unit tests;
- Added DistanceInMeters to API
- Rewrote fraction floating points to integer arithmetic
- Minor fix. Added
unittest\unittest.html
- open to peform tests that try to verify that the library works as intended;
- Minor fixes.
- Fixes to the data rectangles (primarily intended for ISO proposal), see Word document for details.
- Removed unneeded mminfo flags (no effect on functionality).
- Redesign of the API to conform to Javascript standards and match the Java implementation of the mapcode system
- Bugfix for mapcodes in IN-DD (in India).
-
Major release. This version is not backwards compatible with mapcode 1.4x: it has dropped support for Antartica AT0-8 codes and has a changed (improved) way of dealing with the Greek alphabet.
-
Added 22-chararcter post-processing of all-digit mapcodes for the Greek alphabet.
-
Retired legacy aliases EAZ and SKM, AU-QL, AU-TS, AU-NI and AU-JB.
-
Retired legacy Antarctica claims AT0 through AT8.
- Added the India state Telangana (IN-TG), until 2014 a region in Adhra Pradesh.
- Normalise results when longitude below -180 degrees.
-
Prevent FIJI failing to decode at exactly 180 degrees.
-
Prevent invalid filtering near the territory bounding rectangle.
- Make
iso2ccode()
even more forgiving by allowing a state alias to be recognized in context.
- Disable 7-char state codes for large states in India, and instead generate country mapcodes for states.
- Fix for starpipe "zoning" error, causing the last 2 mapcode characters to be ignored in certain areas.
- Support undefined ranges in data array (useful for partial JavaScript builds).
- Added alias OD for India, and 2.3 code for Daman and Diu.
Ccode2iso(c, 2)
support added.
- Public domain release.