[OpenLayers-Users] Text is moving over the map

Wolfgang Wienke wo_wienke at gmx.net
Fri Aug 7 10:55:37 PDT 2015


Hi,
please help a dummy!
Why ist the text moving over the map when zooming?

<div id="map" class="map"></div>
<div style="display:none"><p id="text" >Hallo Welt</p></div>

<script>
var layer    =  new ol.layer.Tile({
	title: 'Luftbild',
	type: 'base',
	source: new ol.source.BingMaps({
			key: apiKey,
			imagerySet: "Aerial"
                        }),
        });

var map = new ol.Map({
  		layers: [layer],
  		target: 'map',
  		view: new ol.View({
			center: [0, 0],
			zoom: 2})
		});

var Welt = new ol.Overlay({
  		positioning: 'center-center',
	  	position:
	ol.proj.transform([6.0362,50.8134],'EPSG:4326', 'EPSG:3857'),
  		element: document.getElementById('text')
		});
map.addOverlay(Welt);
</script>
-- 
                               mit freundlichen Grüssen

                                     Wolfgang Wienke


More information about the Users mailing list