Reference Source

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

  1. Get the configuration information that has been configured before.
  2. Create mapView object and set center and zoom.
  3. Initialize mapView object.
  4. 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!');
  });
});

base

Namespace

A full function name is Kq.module.class.function.

example: KQ.Map.MapConfig.getInstance()

  1. KQ is root namespace.
  2. Map is module name.
  3. MapConfig is class name.
  4. getInstance is function name.