You are here

openlayers-map-array-properties.html in Openlayers 6

File

help/openlayers-map-array-properties.html
View source
The following describes the basic properties that are available in the map array.

<ul>
  <li><strong>id</strong>
    <dl>
      <dt>Values:</dt>
        <dd>string</dd>
      <dt>Description:</dt>
        <dd>This is the string identifier for the map used in PHP and Javascript.  It will be the HTML identifier as well.</dd>
      <dt>Example:</dt>
        <dd>'example-id'</dd>
      <dt>Notes:</dt>
        <dd>This should be unique.  The render function will assign an ID, if none is present.</dd>
    </dl>
  </li>

  <li><strong>projection</strong>
    <dl>
      <dt>Values:</dt>
        <dd>string (number)</dd>
      <dt>Description:</dt>
        <dd>This is the main projection that will be used on the map.</dd>
      <dt>Example:</dt>
        <dd>'900913'</dd>
      <dt>Notes:</dt>
        <dd>The default is 4326.</dd>
    </dl>
  </li>

  <li><strong>width</strong>
    <dl>
      <dt>Values:</dt>
        <dd>string</dd>
      <dt>Description:</dt>
        <dd>The CSS valid width for the map.</dd>
      <dt>Example:</dt>
        <dd>'auto'</dd>
    </dl>
  </li>

  <li><strong>height</strong>
    <dl>
      <dt>Values:</dt>
        <dd>string</dd>
      <dt>Description:</dt>
        <dd>The CSS valid hright for the map.</dd>
      <dt>Example:</dt>
        <dd>'300px'</dd>
    </dl>
  </li>

  <li><strong>center</strong>
    <dl>
      <dt>Values:</dt>
        <dd>array</dd>
      <dt>Description:</dt>
        <dd>The default centering properties for the map, including lat, lon, and zoom.</dd>
      <dt>Example:</dt>
        <dd>
<pre>
array(
  'lat' => 40,
  'lon' => 5,
  'zoom' => 5,
),
</pre>
        </dd>
    </dl>
  </li>
</ul>