Layer Handlers

Last updated on
30 April 2025

This page describes the layers handlers that are available in the core OpenLayers module and the OpenLayers Layers module. (needs work)

KML

You can create a KML layer with the following map array (filling in the blanks of course):

$map = array(
  ...
  'layers' => array(
    'kml_example' => array(
      'id' => 'kml_example',
      'type' => 'KML',
      'name' => t('KML Example'),
      'url' => 'http://url.to.you.kml/feed',
      'options' => array(
        ...
      ),
    ),
  ),
  ...
);

The layer handler formats it for KML. You can see GML API Docs for full set of options.

Important: Please note that you may only reference a KML URL that is on the same domain as your Drupal site. You may not request a KML file from another domain as it is considered an XSS vulnerability. You may with to use a local proxy if you want to use a foreign KML feed.

XYZ

This layer type provides a XYZ OpenLayer layer and automatically puts in the spherical mecrcator, and bound options.

Google

This layer type provides a Google OpenLayer layer of Google map tiles. The layer handler puts in the spherical mecrcator and bound options.

Available map types in ['params']['type']:

  • street
  • satellite
  • hybrid
  • physical

This requires a map API key that can be inputted on the Layer Settings page.

Yahoo

The Yahoo OpenLayer layer works the same as the Google type above.

Available map types in ['params']['type']:

  • street
  • satellite
  • hybrid

This requires a map API key that can be inputted on the Layer Settings page.

Virtual Earth

The Yahoo OpenLayer layer as the Yahoo type above and has the types of tiles

CloudMade

This requires a map API key that can be inputted on the Layer Settings page. This also requires a separate JS library file for integration. See: http://developers.cloudmade.com/wiki/openlayers-api/CloudMade_Tiles

Help improve this page

Page status: Not set

You can: