0.3.3 • Published 11 months ago
@awhere/maps-maptalks v0.3.3
@awhere/maps-maptalks
The awesome aWhere JavaScript API for Maptalks.
Installation
Install the package in your project directory with:
// with npm
npm install @awhere/maps-maptalks
// with yarn
yarn add @awhere/maps-maptalks
Example
<body>
<div id="map"></div>
<script>
let credential;
/* Create credential with Basic API Key */
credential = new awhere.identity.APIKey({
aWhereUrl: '<Your aWhere URL>',
key: '<Your API Key>',
});
/* Create credential with OAuth 2.0 */
// credential = new awhere.identity.OAuth({
// aWhereUrl: '<Your aWhere URL>',
// appId: '<Your App Id>',
// callbackUrl: '/oauth-callback.html',
// });
/* Create credential with Basic Authentication */
// credential = new awhere.identity.BasicAuth({
// aWhereUrl: '<Your aWhere URL>',
// username: '<Your Username>',
// password: '<Your Password>',
// });
/* Create credential with Access Token */
// credential = new awhere.identity.BearerToken({
// aWhereUrl: '<Your aWhere URL>',
// token: '<Your Access Token>',
// });
/* Register credential with identityManager */
awhere.identity.identityManager.registers([credential]);
/* Set default credential */
awhere.identity.identityManager.setDefaultCredential(credential);
/* Use the API */
awhere.map.Map.fromId('map', '<Your Web Map ID>')
.then(map => {
if (!map) {
console.warn('map_id not found.');
return;
}
window.map = map;
console.log(`"window.map" is ready`, map);
})
.catch(err => {
console.warn('error', err);
});
console.log('Use the aWhere JavaScript API for Maptalks here', awhere);
</script>
</body>
0.3.2
1 year ago
0.3.1
1 year ago
0.3.3
11 months ago
0.3.0
3 years ago
0.2.27
3 years ago
0.2.26
3 years ago
0.2.25
4 years ago
0.2.24
4 years ago
0.2.23
4 years ago
0.2.22
4 years ago
0.2.21
4 years ago
0.2.20
4 years ago
0.2.19
4 years ago
0.2.18
4 years ago
0.2.17
4 years ago
0.2.16
4 years ago
0.2.15
4 years ago
0.2.14
4 years ago
0.2.13
4 years ago
0.2.12
4 years ago
0.2.11
4 years ago
0.2.10
4 years ago
0.2.7
4 years ago
0.2.6
4 years ago
0.2.9
4 years ago
0.2.8
4 years ago
0.2.5
4 years ago
0.2.4
4 years ago
0.2.3
4 years ago
0.2.2
4 years ago
0.2.1
4 years ago
0.2.0
5 years ago
0.1.13
5 years ago
0.1.12
5 years ago
0.1.11
5 years ago
0.1.10
5 years ago
0.1.9
5 years ago
0.1.8
5 years ago
0.1.7
5 years ago
0.1.6
5 years ago
0.1.5
5 years ago
0.1.4
5 years ago
0.1.3
5 years ago
0.1.2
5 years ago
0.1.1
5 years ago
0.1.0
5 years ago