EN DE
  • Sign up
  • Log in

Examples with OpenLayers 3 (EPSG:25832)

Map

Code

<!DOCTYPE html>
<html>
  <head>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/proj4js/2.3.12/proj4.js" type="text/javascript"></script>
      
    <script src="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.js" type="text/javascript"></script>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/ol3/4.0.1/ol.css" type="text/css">
    
    <script type='text/javascript'>
      function initMap() {
        var projectionName = 'EPSG:25832';
        proj4.defs(projectionName, '+proj=utm +zone=32 +ellps=GRS80 +towgs84=0,0,0,0,0,0,0 +units=m +no_defs');

        var apiKey = 'your-api-key';
         var host = 'https://maps.omniscale.net/v2/' + apiKey + '/style.default/map';

        var attribution = new ol.Attribution({
          html: '&copy; 2023 &middot; <a href="https://maps.omniscale.com/">Omniscale</a>'+
            '&middot; Map data: <a href="https://www.openstreetmap.org/copyright">OpenStreetMap  (Lizenz: ODbL)</a>'
        });

        var map = new ol.Map({
          target: 'map',
          layers: [
            new ol.layer.Tile({
              source: new ol.source.TileWMS({
                projection: projectionName,
                attributions: [attribution],
                url: host,
                params: {
                  'SRS': 'EPSG:25832',
                  'LAYERS': 'osm'
                }
              })
            })
          ],
          view: new ol.View({
            projection: projectionName,
            center: ol.proj.transform([8.22, 53.15], 'EPSG:4326', projectionName),
            zoom: 13,
            minZoom: 6,
            extent: ol.proj.transformExtent([4, 46, 16, 56], 'EPSG:4326', projectionName)
          })
        });
      };
    </script>
  </head>
  <body onload='initMap()'>
    <div id='map' style='height: 400px; width: 400px;'></div>
  </body>
</html>

Help and Service

  • Register • Login
  • Interactive map
  • Plans and Pricing

Help and Service

  • Help/API
  • Available projections

About us

  • Imprint
  • Terms and Conditions
  • Privacy

Contact details

Omniscale GmbH & Co. KG
Moltkestraße 6a
26122 Oldenburg
Germany
Go to contact form ↝

Copyright © 2023 • Omniscale, Map data: OpenStreetMap (License: ODbL)

This offer only applies to tradesmen. All indicated prices are listed without VAT.

This offer only applies to tradesmen. All indicated prices are listed without VAT.