0.0.5 • Published 5 years ago
map4dsdk v0.0.5
Map4D SDK
Map4D SDK for Web, written in Javascript.
Important Changelogs
- Version 1.2.0
- Use api key for api request
- Version 1.3.1
Installation
Download map4dsdk from here
Add script to your website
<script src="[PATH]/map4dsdk@[version].js"></script>
Note: SDK script name must contains "map4dsdk@"
Using
- Initialize map with access key
<body>
<div id="map"></div>
<script src="[PATH]/map4dsdk@[version].js"></script>
<script>
let map = new map4d.Map(document.getElementById("map"),
{
center: [105.828042, 21.007651],
zoom: 17,
geolocate: true,
controls :true,
tilt: 0,
accessKey: `${your-key}`
}
)
//set switch mode Auto for automatically switching between 2D & 3D
map.setSwitchMode(map4d.SwitchMode.Auto)
map.enable3dMode(true)
</script>
</body>
- Style your view
<style>
body {
margin: 0px;
height: 100%;
}
#map {
position: absolute;
width: 100%;
height: 100%;
background-color: #f2efe9;
}
</style>
Document references
License
Copyright (C) 2016 IOT Link Ltd. All Rights Reserved.