Overview
Include Files
Add the map dom element and the script needed.
<body>
<div id="map"></div>
<script src="../../dist/jquery.min.js"></script>
<script src="../../dist/jquery-ui.min.js"></script>
<script src="../../dist/kqlibs.js"></script>
<script src="../../dist/kqwebmap.min.js"></script>
</body>
Basic Usage
- Get the configuration information that has been configured before.
- Create mapView object and set center and zoom.
- Initialize mapView object.
- After mapView object initialized, output some information.
var config = KQ.Map.MapConfig.getInstance();
config.initAsync('', false, function () {
KQ.Local.setLanguage('cn');
var mapView = new KQ.Map.MapView({
center: [ 30.56, 114.30 ],
zoom: 12,
maxZoom: 16,
}, 'google', 'vector');
mapView.initAsync(function () {
console.log('mapview initialized!');
});
});
Namespace
A full function name is Kq.module.class.function.
example: KQ.Map.MapConfig.getInstance()
- KQ is root namespace.
- Map is module name.
- MapConfig is class name.
- getInstance is function name.