- Help Centre
- 1map Embeddable Viewer
-
Getting Started
-
Finding a property
-
Utilities and Tools
-
Layers
-
Survey Diagrams
-
Bookmarks
-
NetworkManager Guide
-
Spatial Editing
-
Attribute Editing
-
Printing
-
Exporting Data
-
Uploading Your Own Data
-
Collaborate with MapBall
-
1map Mobile
-
Mobile application (for Private Client)
-
Frequently Asked Questions
-
New Features
-
1map Embeddable Viewer
-
Financial Integration for a Municipality
-
Internal
-
1map Subscriptions
-
Quidity
-
Emalahleni
-
CityManager
-
User Management
-
1map Widget
-
FiberTime
-
SG Lodgements
-
Pvt
-
RevenueManager
How to get your Token to access the Web Viewer
The embeddable web viewer requires a token to be passed through to get access to the layers. This article explains how to get the Token.
Your 1map username and password is used to obtain a token that should be passed as a URL parameter to the online Viewer.
Make sure to get your token in the back end as not to expose your username and password in the front end!!
Here is sample code for retrieving your token (Adjust to the back-end language that you are using.):
var 1mapUsername = "map_viewer@1map.co.za";
var 1mapPassword = "map_viewer98";
var token = "";
var jqxhr = $.ajax({
type: "GET",
url: "https://www.1map.co.za/api/v1/auth/login/",
dataType: "json",
timeout: 60000 * 2, // 2 minutes
data: {
email: TEMPmapUsername,
password: TEMPmapPassword,
},
error: function (xhr, status, error) {
// alert(error);
},
success: function (response) {
if (response && response.result) {
token = response.apiToken.token;
if (response.result.maprestriction) {
maprestriction = response.result.maprestriction;
}
}
},
async: false,
});