var layers = [
  {
    "id": 1,
    "name": "Penalty Charge Notice",
    "activeIcon": "images/pcn-red.png",
    "inactiveIcon": "images/pcn_.gif",
    "display": "none",
    "features": [
      {
        "name": "PCN hot spots - high occurance",
        "legend": "icons/PCN-s.gif",
        "icon": "icons/PCN-s.gif",
        "iconwidth": 22,
        "iconheight": 15,
        "tag": "pcnhotspots0",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "pcn",
        "filter": "no_issued >= 1000 and no_issued < 2000 and negative_verified is null",
        "fields": "road_name, no_issued",
        "srid": "27700",
        "template": "<h4>PCN hot spot</h4><table>{if defined('road_name')}<tr><th>Road name</th><td>${road_name}</td></tr>{/if}</table>",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 22,
          "graphicHeight": 15
        }
      },
      {
        "name": "PCN hot spots - very high occurance",
        "legend": "icons/PCN.gif",
        "icon": "icons/PCN.gif",
        "iconwidth": 29,
        "iconheight": 20,
        "tag": "pcnhotspots1",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "pcn",
        "filter": "no_issued >= 2000 and negative_verified is null",
        "fields": "road_name, no_issued",
        "srid": "27700",
        "template": "<h4>PCN hot spot</h4><table>{if defined('road_name')}<tr><th>Road name</th><td>${road_name}</td></tr>{/if}</table>",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 29,
          "graphicHeight": 20
        }
      },
      {
        "name": "Static bus lane camera",
        "legend": "icons/111-B.png",
        "icon": "icons/111-B.png",
        "iconwidth": 16,
        "iconheight": 14,
        "tag": "trafficcamera0",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "trafficcamera",
        "filter": "negative_verified is null AND camera_type='B'",
        "fields": "camera_type,authority,killed_or_seriously_injured",
        "srid": "27700",
        "template": "<h4>{if defined('camera_type') && camera_type == 'T'}Traffic camera{elseif defined('camera_type') && camera_type == 'B'}Bus lane camera{else}Speed camera{/if}</h4>{if defined('authority')}<table><tr><th>Authority</th><td>${authority}</td></tr></table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 14
        }
      },
      {
        "name": "Traffic camera",
        "legend": "icons/111-T.png",
        "icon": "icons/111-T.png",
        "iconwidth": 16,
        "iconheight": 14,
        "tag": "trafficcamera1",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "trafficcamera",
        "filter": "negative_verified is null AND camera_type='T'",
        "fields": "camera_type,authority,killed_or_seriously_injured",
        "srid": "27700",
        "template": "<h4>{if defined('camera_type') && camera_type == 'T'}Traffic camera{elseif defined('camera_type') && camera_type == 'B'}Bus lane camera{else}Speed camera{/if}</h4>{if defined('authority')}<table><tr><th>Authority</th><td>${authority}</td></tr></table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 14
        }
      },
      {
        "name": "Speed camera low accident risk",
        "legend": "icons/111-L_.png",
        "icon": "icons/111-L_.png",
        "iconwidth": 16,
        "iconheight": 14,
        "tag": "trafficcamera2",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "trafficcamera",
        "filter": "negative_verified is null AND killed_or_seriously_injured < 4",
        "fields": "camera_type,authority,killed_or_seriously_injured",
        "srid": "27700",
        "template": "<h4>{if defined('camera_type') && camera_type == 'T'}Traffic camera{elseif defined('camera_type') && camera_type == 'B'}Bus lane camera{else}Speed camera{/if}</h4>{if defined('authority')}<table><tr><th>Authority</th><td>${authority}</td></tr></table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 14
        }
      },
      {
        "name": "Speed camera medium accident risk",
        "legend": "icons/111-M_.png",
        "icon": "icons/111-M_.png",
        "iconwidth": 16,
        "iconheight": 14,
        "tag": "trafficcamera3",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "trafficcamera",
        "filter": "negative_verified is null AND killed_or_seriously_injured >= 4 AND killed_or_seriously_injured < 8",
        "fields": "camera_type,authority,killed_or_seriously_injured",
        "template": "<h4>{if defined('camera_type') && camera_type == 'T'}Traffic camera{elseif defined('camera_type') && camera_type == 'B'}Bus lane camera{else}Speed camera{/if}</h4>{if defined('authority')}<table><tr><th>Authority</th><td>${authority}</td></tr></table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 14
        }
      },
      {
        "name": "Speed camera high accident risk",
        "legend": "icons/111-H_.png",
        "icon": "icons/111-H_.png",
        "iconwidth": 16,
        "iconheight": 14,
        "tag": "trafficcamera4",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "trafficcamera",
        "filter": "negative_verified is null AND (killed_or_seriously_injured is null OR(killed_or_seriously_injured >= 8)) AND camera_type!='T' AND camera_type!='B'",
        "fields": "camera_type,authority,killed_or_seriously_injured",
        "srid": "27700",
        "template": "<h4>{if defined('camera_type') && camera_type == 'T'}Traffic camera{elseif defined('camera_type') && camera_type == 'B'}Bus lane camera{else}Speed camera{/if}</h4>{if defined('authority')}<table><tr><th>Authority</th><td>${authority}</td></tr></table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 14
        }
      }
    ]
  },
  {
    "id": 2,
    "name": "Parking",
    "activeIcon": "images/car-red.png",
    "inactiveIcon": "images/icon_car__.gif",
    "display": "block",
    "zoomonselect": true,
    "features": [
      {
        "name": "Red box / route loading bay unrestricted use",
        "legend": "icons/ru.png",
        "icon": "icons/ru.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "rrbunrest",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "boxbay",
        "filter": "negative_verified is null and loading_unloading_allowed and loading_time_limit=24",
        "fields": "street_name, no_bays",
        "srid": "27700",
        "template": "<h4>Red box / route loading bay</h4><p>There are no restrictions on this bay.</p>{if defined('street_name') || defined('no_bays')}<table>{if defined('street_name')}<tr><th>Street name</th><td>${street_name}</td></tr>{/if}{if defined('no_bays')}<tr><th>Number of bays</th><td>${no_bays}</td></tr>{/if}</table>{else}<p>No information available.</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Red box / route loading bay restricted use - check times locally",
        "legend": "icons/r.png",
        "icon": "icons/r.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "rrbrestricted",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "boxbay",
        "filter": "negative_verified is null and loading_unloading_allowed and loading_time_limit is null",
        "fields": "street_name, no_bays",
        "srid": "27700",
        "template": "<h4>Red box / route loading bay</h4><p>This bay has restrictions - check times locally.</p>{if defined('street_name') || defined('no_bays')}<table>{if defined('street_name')}<tr><th>Street name</th><td>${street_name}</td></tr>{/if}{if defined('no_bays')}<tr><th>Number of bays</th><td>${no_bays}</td></tr>{/if}</table>{else}<p>No information available.</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Loading bay unrestricted use",
        "legend": "icons/28-BBU.png",
        "icon": "icons/28-BBU.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "loadingbayunrestricteduse",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "loadunloadbay",
        "filter": "negative_verified is null and max_stay=24",
        "fields": "no_bays, restriction",
        "srid": "27700",
        "template": "<h4>Loading bay unrestricted use</h4>{if defined('restriction') || defined('no_bays')}<table>{if defined('restriction')}<tr><th>Restriction </th><td>${restriction}</td></tr>{/if}{if defined('no_bays')}<tr><th>Number of bays</th><td>${no_bays}</td></tr>{/if}</table>{else}<p>No information available.</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Loading bay restricted use - check times locally",
        "legend": "icons/28-BB.png",
        "icon": "icons/28-BB.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "loadingbayrestrictedusechecktimeslocally",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "loadunloadbay",
        "filter": "negative_verified is null and max_stay is null",
        "fields": "no_bays, restriction",
        "srid": "27700",
        "template": "<h4>Loading bay restricted use</h4><p>Check times locally.</p>{if defined('restriction') || defined('no_bays')}<table>{if defined('restriction')}<tr><th>Restriction </th><td>${restriction}</td></tr>{/if}{if defined('no_bays')}<tr><th>Number of bays</th><td>${no_bays}</td></tr>{/if}</table>{else}<p>No information available.</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Car park with height restriction below 1.8m",
        "legend": "icons/p-1.8.gif",
        "icon": "icons/p-1.8.gif",
        "iconwidth": 16,
        "iconheight": 17,
        "tag": "carpark0",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "carpark",
        "filter": "negative_verified is null and height_restriction < 1.8",
        "fields": "name, description, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, sunday_restrictions_from, type, saturday_restrictions_from, sunday_restrictions_to, saturday_restrictions_to, weekend_restrictions, height_restriction, restrictions, baby_change_facilities, monday_opening, public_toilet, congestion_charge_point, monday_closing",
        "srid": "27700",
        "template": "{var types = []}{eval}types['PD'] = 'Pay & Display';types['S'] = 'Surface';types['L'] = 'Lift';types['LS'] = 'Long Stay';types['SS'] = 'Short Stay';types['R'] = 'Rooftop';types['UG'] = 'Underground';types['BC'] = 'Barrier Control';types['MS'] = 'Multi-Storey';{/eval}<h4>{if defined('name')}${name}{else}Car Park{/if}</h4>{if defined('description')}<p>${description}</p>{/if}{if defined('address_1')}<p>${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone Number: ${phone}</p>{/if}{if defined('monday_opening') || defined('monday_closing')|| defined('saturday_restrictions_from') || defined('saturday_restrictions_to')|| defined('sunday_restrictions_from') || defined('sunday_restrictions_to')|| defined('restrictions') || defined('weekend_restrictions')|| defined('congestion_charge_point') || defined('public_toilet')|| defined('type') || defined('height_restriction') }<table>{if defined('monday_opening') && defined('monday_closing')}<tr><th>Weekday Opening</th><td>${monday_opening} - ${monday_closing}</td></tr>{/if}{if defined('saturday_restrictions_from') && defined('saturday_restrictions_to')}<tr><th>Saturday Restrictions</th><td>${saturday_restrictions_from} - ${saturday_restrictions_to}</td></tr>{/if}{if defined('sunday_restrictions_from') && defined('sunday_restrictions_to')}<tr><th>Sunday Opening</th><td>${sunday_restrictions_from} - ${sunday_restrictions_to}</td></tr>{/if}{if defined('restrictions')}<tr><th>Restrictions</th><td>${restrictions}</td></tr>{/if}{if defined('weekend_restrictions')}<tr><th>Weekend restrictions</th><td>${weekend_restrictions}</td></tr>{/if}{if defined('congestion_charge_point')}<tr><th>Congestion Charge Point</th><td>{if congestion_charge_point=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('public_toilet')}<tr><th>Public Toilet</th><td>{if public_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('type')}<tr><th>Type</th><td>${types[type]}</td></tr>{/if}{if defined('height_restriction')}<tr><th>Height Restriction</th><td>${height_restriction}m</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 17
        }
      },
      {
        "name": "Car park with height restriction between 1.8m-3.2m",
        "legend": "icons/p-1.8-3.2.gif",
        "icon": "icons/p-1.8-3.2.gif",
        "iconwidth": 16,
        "iconheight": 17,
        "tag": "carpark1",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "carpark",
        "filter": "negative_verified is null and height_restriction >= 1.8 and height_restriction < 3.2",
        "fields": "name, description, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, sunday_restrictions_from, type, saturday_restrictions_from, sunday_restrictions_to, saturday_restrictions_to, weekend_restrictions, height_restriction, restrictions, baby_change_facilities, monday_opening, public_toilet, congestion_charge_point, monday_closing",
        "srid": "27700",
        "template": "{var types = []}{eval}types['PD'] = 'Pay & Display';types['S'] = 'Surface';types['L'] = 'Lift';types['LS'] = 'Long Stay';types['SS'] = 'Short Stay';types['R'] = 'Rooftop';types['UG'] = 'Underground';types['BC'] = 'Barrier Control';types['MS'] = 'Multi-Storey';{/eval}<h4>{if defined('name')}${name}{else}Car Park{/if}</h4>{if defined('description')}<p>${description}</p>{/if}{if defined('address_1')}<p>${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone Number: ${phone}</p>{/if}{if defined('monday_opening') || defined('monday_closing')|| defined('saturday_restrictions_from') || defined('saturday_restrictions_to')|| defined('sunday_restrictions_from') || defined('sunday_restrictions_to')|| defined('restrictions') || defined('weekend_restrictions')|| defined('congestion_charge_point') || defined('public_toilet')|| defined('type') || defined('height_restriction') }<table>{if defined('monday_opening') && defined('monday_closing')}<tr><th>Weekday Opening</th><td>${monday_opening} - ${monday_closing}</td></tr>{/if}{if defined('saturday_restrictions_from') && defined('saturday_restrictions_to')}<tr><th>Saturday Restrictions</th><td>${saturday_restrictions_from} - ${saturday_restrictions_to}</td></tr>{/if}{if defined('sunday_restrictions_from') && defined('sunday_restrictions_to')}<tr><th>Sunday Opening</th><td>${sunday_restrictions_from} - ${sunday_restrictions_to}</td></tr>{/if}{if defined('restrictions')}<tr><th>Restrictions</th><td>${restrictions}</td></tr>{/if}{if defined('weekend_restrictions')}<tr><th>Weekend restrictions</th><td>${weekend_restrictions}</td></tr>{/if}{if defined('congestion_charge_point')}<tr><th>Congestion Charge Point</th><td>{if congestion_charge_point=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('public_toilet')}<tr><th>Public Toilet</th><td>{if public_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('type')}<tr><th>Type</th><td>${types[type]}</td></tr>{/if}{if defined('height_restriction')}<tr><th>Height Restriction</th><td>${height_restriction}m</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 17
        }
      },
      {
        "name": "Car park with height restriction between 3.2m-3.65m",
        "legend": "icons/p3.2-3.65.gif",
        "icon": "icons/p3.2-3.65.gif",
        "iconwidth": 16,
        "iconheight": 17,
        "tag": "carpark2",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "carpark",
        "filter": "negative_verified is null and height_restriction >= 3.2 and height_restriction < 3.65",
        "fields": "name, description, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, sunday_restrictions_from, type, saturday_restrictions_from, sunday_restrictions_to, saturday_restrictions_to, weekend_restrictions, height_restriction, restrictions, baby_change_facilities, monday_opening, public_toilet, congestion_charge_point, monday_closing",
        "srid": "27700",
        "template": "{var types = []}{eval}types['PD'] = 'Pay & Display';types['S'] = 'Surface';types['L'] = 'Lift';types['LS'] = 'Long Stay';types['SS'] = 'Short Stay';types['R'] = 'Rooftop';types['UG'] = 'Underground';types['BC'] = 'Barrier Control';types['MS'] = 'Multi-Storey';{/eval}<h4>{if defined('name')}${name}{else}Car Park{/if}</h4>{if defined('description')}<p>${description}</p>{/if}{if defined('address_1')}<p>${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone Number: ${phone}</p>{/if}{if defined('monday_opening') || defined('monday_closing')|| defined('saturday_restrictions_from') || defined('saturday_restrictions_to')|| defined('sunday_restrictions_from') || defined('sunday_restrictions_to')|| defined('restrictions') || defined('weekend_restrictions')|| defined('congestion_charge_point') || defined('public_toilet')|| defined('type') || defined('height_restriction') }<table>{if defined('monday_opening') && defined('monday_closing')}<tr><th>Weekday Opening</th><td>${monday_opening} - ${monday_closing}</td></tr>{/if}{if defined('saturday_restrictions_from') && defined('saturday_restrictions_to')}<tr><th>Saturday Restrictions</th><td>${saturday_restrictions_from} - ${saturday_restrictions_to}</td></tr>{/if}{if defined('sunday_restrictions_from') && defined('sunday_restrictions_to')}<tr><th>Sunday Opening</th><td>${sunday_restrictions_from} - ${sunday_restrictions_to}</td></tr>{/if}{if defined('restrictions')}<tr><th>Restrictions</th><td>${restrictions}</td></tr>{/if}{if defined('weekend_restrictions')}<tr><th>Weekend restrictions</th><td>${weekend_restrictions}</td></tr>{/if}{if defined('congestion_charge_point')}<tr><th>Congestion Charge Point</th><td>{if congestion_charge_point=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('public_toilet')}<tr><th>Public Toilet</th><td>{if public_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('type')}<tr><th>Type</th><td>${types[type]}</td></tr>{/if}{if defined('height_restriction')}<tr><th>Height Restriction</th><td>${height_restriction}m</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 17
        }
      },
      {
        "name": "Car park with no height restriction",
        "legend": "icons/p-none.gif",
        "icon": "icons/p-none.gif",
        "iconwidth": 16,
        "iconheight": 17,
        "tag": "carpark3",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "carpark",
        "filter": "negative_verified is null and (height_restriction is null OR height_restriction >= 3.65)",
        "fields": "name, description, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, sunday_restrictions_from, type, saturday_restrictions_from, sunday_restrictions_to, saturday_restrictions_to, weekend_restrictions, height_restriction, restrictions, baby_change_facilities, monday_opening, public_toilet, congestion_charge_point, monday_closing",
        "srid": "27700",
        "template": "{var types = []}{eval}types['PD'] = 'Pay & Display';types['S'] = 'Surface';types['L'] = 'Lift';types['LS'] = 'Long Stay';types['SS'] = 'Short Stay';types['R'] = 'Rooftop';types['UG'] = 'Underground';types['BC'] = 'Barrier Control';types['MS'] = 'Multi-Storey';{/eval}<h4>{if defined('name')}${name}{else}Car Park{/if}</h4>{if defined('description')}<p>${description}</p>{/if}{if defined('address_1')}<p>${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone Number: ${phone}</p>{/if}{if defined('monday_opening') || defined('monday_closing')|| defined('saturday_restrictions_from') || defined('saturday_restrictions_to')|| defined('sunday_restrictions_from') || defined('sunday_restrictions_to')|| defined('restrictions') || defined('weekend_restrictions')|| defined('congestion_charge_point') || defined('public_toilet')|| defined('type') || defined('height_restriction') }<table>{if defined('monday_opening') && defined('monday_closing')}<tr><th>Weekday Opening</th><td>${monday_opening} - ${monday_closing}</td></tr>{/if}{if defined('saturday_restrictions_from') && defined('saturday_restrictions_to')}<tr><th>Saturday Restrictions</th><td>${saturday_restrictions_from} - ${saturday_restrictions_to}</td></tr>{/if}{if defined('sunday_restrictions_from') && defined('sunday_restrictions_to')}<tr><th>Sunday Opening</th><td>${sunday_restrictions_from} - ${sunday_restrictions_to}</td></tr>{/if}{if defined('restrictions')}<tr><th>Restrictions</th><td>${restrictions}</td></tr>{/if}{if defined('weekend_restrictions')}<tr><th>Weekend restrictions</th><td>${weekend_restrictions}</td></tr>{/if}{if defined('congestion_charge_point')}<tr><th>Congestion Charge Point</th><td>{if congestion_charge_point=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('public_toilet')}<tr><th>Public Toilet</th><td>{if public_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('type')}<tr><th>Type</th><td>${types[type]}</td></tr>{/if}{if defined('height_restriction')}<tr><th>Height Restriction</th><td>${height_restriction}m</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 17
        }
      }
    ]
  },
  {
    "id": 3,
    "name": "Loading Unloading Restrictions",
    "activeIcon": "images/loading-red.png",
    "inactiveIcon": "images/loading_.gif",
    "display": "none",
    "features": [
      {
        "name": "No loading or unloading - Anytime",
        "legend": "icons/anytime.png",
        "icon": "icons/anytime.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip0",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='No Loading at any time'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      },
      {
        "name": "No loading or unloading - Majority of working day",
        "legend": "icons/majority.png",
        "icon": "icons/majority.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip1",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='Majority of working day'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      },
      {
        "name": "No loading or unloading - am peak period",
        "legend": "icons/am-peak-period_.png",
        "icon": "icons/am-peak-period_.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip2",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='AM Peak Period'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      },
      {
        "name": "No loading or unloading - am / pm rush hour",
        "legend": "icons/am-pm-rush-hour.png",
        "icon": "icons/am-pm-rush-hour.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip3",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='AM/PM Rush hour only'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      },
      {
        "name": "No loading or unloading - Check locally",
        "legend": "icons/check-locally.png",
        "icon": "icons/check-locally.png",
        "iconwidth": 12,
        "iconheight": 12,
        "tag": "loadingpip4",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND (description='Check Locally' OR description='Check locally 2')",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 12,
          "graphicHeight": 12
        }
      },
      {
        "name": "No loading or unloading - pm peak period",
        "legend": "icons/pm-peak-period_.png",
        "icon": "icons/pm-peak-period_.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip5",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='PM Peak Period'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      },
      {
        "name": "No loading or unloading - saturday",
        "legend": "icons/saturday.png",
        "icon": "icons/saturday.png",
        "iconwidth": 11,
        "iconheight": 11,
        "tag": "loadingpip6",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id,centroid(geometry) as geometry,name,paid_description from loadingpip where negative_verified is null) as foo",
        "filter": "source_id=4 AND description='Saturday Only'",
        "fields": "name,description",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>Restriction Type : ${description}</p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 11,
          "graphicHeight": 11
        }
      }
    ]
  },
  {
    "id": 4,
    "name": "Useful Information",
    "activeIcon": "images/useful-red.png",
    "inactiveIcon": "images/useful-information_.gif",
    "display": "none",
    "features": [
      {
        "name": "Petrol station",
        "legend": "icons/petrolstation.png",
        "icon": "icons/petrolstation.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "ps",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "petrolstation",
        "filter": "negative_verified is null",
        "fields": "name, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, service_call, twentyfour_hours, lpg, public_toilet, congestion_charge_point, cash_machine, disabled_toilet",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('address_1')}<p>${address_1}{if defined('address_2')}<br /> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Tel: ${phone}</p>{/if}{if defined('congestion_charge_point') || defined('twentyfour_hours') || defined('lpg')|| defined('public_toilet') || defined('disabled_toilet') || defined('cash_machine')|| defined('service_call')}<table>{if defined('congestion_charge_point')}<tr><th>Congestion Charge point</th><td>{if congestion_charge_point=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('twentyfour_hours')}<tr><th>24hr opening</th><td>{if twentyfour_hours=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('lpg')}<tr><th>LPG available</th><td>{if lpg=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('public_toilet')}<tr><th>Public toilet</th><td>{if public_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('disabled_toilet')}<tr><th>Disabled toilet</th><td>{if disabled_toilet=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('cash_machine')}<tr><th>Cash machine</th><td>{if cash_machine=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('service_call')}<tr><th>Service call</th><td>{if service_call=='t'}Yes{else}No{/if}</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Cafe",
        "legend": "icons/cafe_.png",
        "icon": "icons/cafe_.png",
        "iconwidth": 16,
        "iconheight": 16,
        "tag": "cafe",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "restaurant",
        "filter": "negative_verified is null and type='CAFE'",
        "fields": "description, name, address_building_number, address_building_name, address_1, address_2, address_3, address_4, address_city, address_postcode, phone, web",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('description')}<p>${description}</p>{/if}{if defined('address_1')}<p>{if defined('address_building_name')}${address_building_name}<br/>{/if}{if defined('address_building_number')}${address_building_number}&nbsp;{/if}${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_postcode')}&nbsp;${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Tel: ${phone}</p>{/if}{if defined('web')}<p>Web: <a href=\\\"${web}\\\" target=\\\"_blank\\\">click here</a></p>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 16,
          "graphicHeight": 16
        }
      },
      {
        "name": "Volkswagen Van Centre (service & sales)",
        "legend": "icons/vw.png",
        "icon": "icons/vw.png",
        "iconwidth": 20,
        "iconheight": 20,
        "tag": "volkswagenvancentreservicesales",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "vandealer",
        "filter": "(new_vehicles and used_vehicles and service) and vehicle_brands ~ '(Volks|VW|^All makes, all models$)'",
        "fields": "name, address_building_name, address_building_number, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, web, new_vehicles, used_vehicles, service, mot, spare_parts",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('address_1')}<p>{if defined('address_building_name')}${address_building_name}<br/>{/if}{if defined('address_building_number')}${address_building_number}&nbsp;{/if}${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone number: ${phone}</p>{/if}{if defined('web')}<p>Web link: <a href=\\\"${web}\\\">click</a></p>{/if}{if defined('new_vehicles') || defined('used_vehicles')|| defined('service') || defined('mot') || defined('spare_parts')}<table>{if defined('new_vehicles')}<tr><th>New vehicles</th><td>{if new_vehicles=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('used_vehicles')}<tr><th>Used vehicles</th><td>{if used_vehicles=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('mot')}<tr><th>MOT</th><td>{if mot=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('service')}<tr><th>Service</th><td>{if service=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('spare_parts')}<tr><th>Spare parts</th><td>{if spare_parts=='t'}Yes{else}No{/if}</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 20,
          "graphicHeight": 20
        }
      },
      {
        "name": "Volkswagen Van Service Centre",
        "legend": "icons/vws.png",
        "icon": "icons/vws.png",
        "iconwidth": 20,
        "iconheight": 19,
        "tag": "volkswagenvanservicecentre",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "vandealer",
        "filter": "((not new_vehicles or new_vehicles is null) and (not used_vehicles or used_vehicles is null) and service) and vehicle_brands ~ '(Volks|VW|^All makes, all models$)'",
        "fields": "name, address_building_name, address_building_number, address_1, address_2, address_3, address_4, address_city, address_county, address_postcode, phone, web, new_vehicles, used_vehicles, service, mot, spare_parts",
        "srid": "27700",
        "template": "<h4>${name}</h4>{if defined('address_1')}<p>{if defined('address_building_name')}${address_building_name}<br/>{/if}{if defined('address_building_number')}${address_building_number}&nbsp;{/if}${address_1}{if defined('address_2')}<br/> ${address_2}{/if}{if defined('address_3')}<br /> ${address_3}{/if}{if defined('address_4')}<br /> ${address_4}{/if}{if defined('address_city')}<br /> ${address_city}{/if}{if defined('address_county')}<br /> ${address_county}{/if}{if defined('address_postcode')}<br /> ${address_postcode}{/if}</p>{/if}{if defined('phone')}<p>Phone number: ${phone}</p>{/if}{if defined('web')}<p>Web link: <a href=\\\"${web}\\\">click</a></p>{/if}{if defined('new_vehicles') || defined('used_vehicles')|| defined('service') || defined('mot') || defined('spare_parts')}<table>{if defined('new_vehicles')}<tr><th>New vehicles</th><td>{if new_vehicles=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('used_vehicles')}<tr><th>Used vehicles</th><td>{if used_vehicles=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('mot')}<tr><th>MOT</th><td>{if mot=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('service')}<tr><th>Service</th><td>{if service=='t'}Yes{else}No{/if}</td></tr>{/if}{if defined('spare_parts')}<tr><th>Spare parts</th><td>{if spare_parts=='t'}Yes{else}No{/if}</td></tr>{/if}</table>{/if}",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 20,
          "graphicHeight": 19
        }
      }
    ]
  },
  {
    "id": 5,
    "name": "Highway Restrictions",
    "activeIcon": "images/restriction-red.png",
    "inactiveIcon": "images/restriction_.gif",
    "display": "none",
    "features": [
      {
        "name": "Weight restriction (T)",
        "legend": "icons/weightrestriction.png",
        "icon": "icons/weightrestriction.png",
        "iconwidth": 24,
        "iconheight": 24,
        "tag": "weightrestriction",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id, geometry, name, case when weight_restriction % 1 = 0 then round(weight_restriction) else round(weight_restriction, 1) end as weight_restriction from heightweightrestriction where weight_restriction is not null and weight_restriction != 0 and negative_verified is null) as foo",
        "filter": "",
        "fields": "name,weight_restriction",
        "srid": "27700",
        "template": "<h4>Weight restriction</h4>{if defined('name')}<p>${name}</p>{/if}<p>Restriction: ${weight_restriction}T</p>",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 24,
          "graphicHeight": 24,
          "attributeLabel": "weight_restriction",
          "fontSize": "9px",
          "fontFamily": "verdana"
        }
      },
      {
        "name": "Width restriction (m)",
        "legend": "icons/widthrestriction.png",
        "icon": "icons/widthrestriction.png",
        "iconwidth": 24,
        "iconheight": 24,
        "tag": "widthrestriction",
        "display": false,
        "displayAtZoom": [
          3,4,5
        ],
        "geometry": "p",
        "table": "(select id, geometry, name, case when width_restriction % 1 = 0 then round(width_restriction) else round(width_restriction, 1) end as width_restriction from heightweightrestriction where width_restriction is not null and negative_verified is null) as foo",
        "filter": "",
        "fields": "name,width_restriction",
        "srid": "27700",
        "template": "<h4>Width restriction</h4>{if defined('name')}<p>${name}</p>{/if}<p>Restriction: ${width_restriction}m</p>",
        "style": {
          "externalGraphicIsIcon": true,
          "graphicWidth": 24,
          "graphicHeight": 24,
          "attributeLabel": "width_restriction",
          "fontSize": "9px",
          "fontFamily": "verdana"
        }
      }
    ]
  }
];

