block by ThomasG77 16bfcdab4671c7e8a300

16bfcdab4671c7e8a300

Full Screen

index.html

<!doctype html>
<html lang="en">
  <head>
    <link rel="stylesheet" href="//openlayers.org/en/v3.0.0/css/ol.css" type="text/css">
    <style>
      body {
        margin: 0;
        padding: 0;
      }
      .map {
        height: 400px;
        width: 100%;
      }
    </style>
    <script src="//openlayers.org/en/v3.0.0/build/ol.js" type="text/javascript"></script>
    <title>OpenLayers 3 - debug error</title>
  </head>
  <body>
    <div id="map" class="map"></div>
    <script type="text/javascript">

    var projection_lan = 'EPSG:4326';
    var projection_lat = 'EPSG:3857';
    var map;

    var pos = ol.proj.transform([ 12.102727890014648, 49.017269896565764 ],projection_lan, projection_lat);

    function init() {

        var localTiles = new ol.layer.Tile({
            source : new ol.source.XYZ({
                url : this.tiles_url
            })
        });

        this.map = new ol.Map({
            layers : [ new ol.layer.Tile({
                source : new ol.source.MapQuest({
                    layer : 'sat'
                })
            }) ],
            target : 'map',
            view : new ol.View({
                center : pos,
                zoom : 10
            })
        });

        var iconFeature = new ol.Feature(
            {geometry : new ol.geom.Point(pos)
        });

        var iconStyle = new ol.style.Style({
            image : new ol.style.Icon({
                src : '//ol3js.org/en/master/examples/data/icon.png'
            })
        });

        iconFeature.setStyle(iconStyle);

        var vectorSource = new ol.source.Vector({
            features : [ iconFeature ]
        });

        var vectorLayer = new ol.layer.Vector({
            source : vectorSource
        });

        this.map.addLayer(vectorLayer);
    }
    init();
    </script>
  </body>
</html>