[OpenLayers-Users] sneaf ;-( nobody helps me

Brent Fraser bfraser at geoanalytic.com
Fri Jun 26 10:08:26 PDT 2015


Wolfgang,

  In web mapping we typically deal in three different types of 
coordinate systems (Experts: yes, this a vast over-simplification):

1. pixels (because images and displays use them)
2. latitude and longitude (used to allow the location of a point on our 
spherical-ish world using only two numbers)
3. "projected" coordinates (an attempt to use math to show the surface 
of a sphere on a flat plane)

The mapping community has agreed on a set of common map projections and 
given them identifiers (for example "EPSG:3857").  The "EPSG:3857" 
projection will take latitude,longitude coordinates and output 
coordinates in meters.  Typically these range in millions of meters, and 
to show the entire planet in that projection would be an extent of:

-20037508.34, -20037508.34, 20037508.34, 20037508.34

So for example the for Germany the "EPSG:3857" extent might be

457400, 6088000, 1653500, 7380000

  OpenLayers expects ImageExtent must be given in projected coordinates 
like those above.    You need to figure out the projected extent of your 
image; hopefully the creator of the image can give you that information.

I've made some changes to your code (but i have not tested it) to show 
the concepts:

<script>
     var apiKey = 
"AgBbMqJKmhNhpAAHQBpa4OkUPiq-ipzDOcCG7mDGTm2ORrIFM52j1qdIdixf7SF-";

var extent = [457400, 6088000, 1653500, 7380000];
var projection = new ol.proj.Projection({ code: 'EPSG:3857', units: 'm', 
extent: extent });

var bild =   new ol.layer.Image({
                   source: new ol.source.ImageStatic({
                         url: '../windflaechen/300m.png',
                         projection: projection,
                         imageSize: [436, 600],
                         imageExtent: extent
                           })
                 });

var satmap    =  new ol.layer.Tile({
                     source: new ol.source.BingMaps({
                         key: apiKey,
                         imagerySet: "Aerial"
                         }),
                     });

map = new ol.Map({
         target: 'map',
         layers: [satmap, bild],
         view: new ol.View({ center: ol.proj.transform([1055000, 
6734000], projection, 'EPSG:3857'), zoom: 2 }), });

</script>

Best Regards,
Brent Fraser

On 6/26/2015 9:56 AM, Wolfgang Wienke wrote:
> Hi,
> cannot be, that my question ist too difficult. Am I too much of a dummy?
>
> https://www.mail-archive.com/openlayers-users@lists.osgeo.org/msg12710.html
>
> Help would be very nice!




More information about the Users mailing list