logo
Tutorials Examples naver map js api v3 네이버 지도 API Layers

Layers

A layer is a map type that is displayed on top of map tiles. The NAVER Maps API v3 provides the following five layers by default.

  • A layer displaying bicycle lanes and bicycle-related overlays.
  • A layer displaying traffic information.
  • A layer displaying areas where Street View is enabled.
  • A layer displaying information including land, land-lot, classification of land, boundaries, roads and railroads.
  • A hybrid layer displaying the basic map type and the satellite map type.

Like map types, you can create custom layers, other than those provided by the NAVER Maps API v3. For more information, refer to Create custom layers.

Display default layers

To display a default layer provided by the NAVER Maps API v3, create an instance of the layer and call the setMap method of the Map object.

var cadastralLayer = new naver.maps.CadastralLayer();
var streetLayer = new naver.maps.StreetLayer();
var bicycleLayer = new naver.maps.BicycleLayer();
var trafficLayer = new naver.maps.TrafficLayer();

naver.maps.Event.once(map, 'init', function() {
    cadastralLayer.setMap(map);
    streetLayer.setMap(map);
    bicycleLayer.setMap(map);
    trafficLayer.setMap(map);
});

Examples: Displaying the NAVER bicycle layer

Examples: Displaying the NAVER cadastral map layer

Examples: Displaying the NAVER live traffic layer

Create custom layers

A layer is a [map type] that is displayed on top of the default tile. So, you should implement things required to create a map type as well as should use the Layer class to create a custom layer.

For how to create a custom map type, refer to Map Types.

The Layer class provides various methods that need to be implemented to create a layer. That is, create a custom map type and add it to the map type repository.

var myMapTypeRegistry = new naver.maps.MapTypeRegistry({
    'myLayer': myLayerType
}, 'myLayer');

When creating a Layer object, pass the map type repository previously created as an argument, and call the setMap method of the Map object to display the layer.

var myLayer = new naver.maps.Layer('myLayer', myMapTypeRegistry);
myLayer.setMap(map);

Examples: Creating a custom layer