back | source
Traffic map creation
  1. Traffic map creation
    map = new longdo.Map({
      layer: [
        longdo.Layers.GRAY_EN,
        longdo.Layers.TRAFFIC
      ],
      zoom: 12,
      placeholder: document.getElementById('map'),
      lastView: false.
      language: 'en'
    });
    • layer: Map layers can be stacked
    • zoom: initial zoom value
    • placeholder: A DOM element to place the map in
    • lastView: Move to latest position
    More information: Longdo.Map configuration

  2. Show overlays
    map.Overlays.load(longdo.Overlays.events);
    map.Overlays.load(longdo.Overlays.cameras);
    • Parameter : Overlays type

Add/Remove layers
  1. Add traffic layer
    map.Layers.add(longdo.Layers.TRAFFIC);
    Example
  2. Remove traffic layer
    map.Layers.remove(longdo.Layers.TRAFFIC);
    Example
  3. Clear all layers
    map.Layers.clear();
    Example

Add/Remove overlays
  1. Load overlays based on type
    map.Overlays.load(longdo.Overlays.cameras);
    Example
  2. Hide overlays based on type
    map.Overlays.unload(longdo.Overlays.events)
    Example