Please create and activate an account. Afterwards send an email to forum@openseamap.eu including a short message and your username to get write access to this forum. Thanks!
Bitte erstelle einen neuen Account und schalte ihn frei. Anschließend sende eine kurze Mail mit deinem Nutzernamen an forum@openseamap.eu um Schreibzugriff für dieses Forum zu bekommen. Danke!
This server undergoes periodic maintenance and will be unavailable for a few minutes between 00:00 UTC and 01:30 UTC at the first day of the month. New posts during that time could potentially be lost.
Dieser Server wird regelmäßig gewartet und ist deshalb für einige Minuten zwischen 00:00 UTC und 01:30 UTC am Monatsanfang nicht erreichbar. Es kann sein, dass in dieser Zeit erstellte Beiträge verloren gehen.
You are not logged in.
Pages: 1
Hi,
does anybody know how to implement the seamark-layer in Openlayers 3?
In OpenLayers 2 it worked like this:
var layer_seamark = new OpenLayers.Layer.TMS ( "seamark", "http://tiles.openseamap.org/seamark/",
{ numZoomLevels: 18, type: 'png', getURL:getTileURL, isBaseLayer:false, displayOutsideMaxExtent:true });
map.addLayer(layer_seamark);
But in OpenLayers 3 there is no layer.tms anymore.
Anybody an idea??!?
Offline
I adapted the documentation.
Offline
Doesn't work with me
Firefox - Firebug meldet mir:
SecurityError: The operation is insecure.
http://ol3js.org/en/master/build/ol.js
Line 258
No Seamarks are show and Error counter is running like hell in Firebug.
Last edited by SAILBOOK (2013-11-20 12:07:01)
Offline
In my opinion you should avoid referencing to external scripts in your application. Several problems can occur:
* If the remote host is not available, your application won't work.
* If the remote version changes, your application may crash.
* People with activated security plugins like 'NoScript' have to unblock such external references as well.
I downloaded the last version and copied both files (ol.css and ol.js) into the corresponding
directory. Works with Firefox and Chrome.
Offline
Could you send me an example? I can't get it working. If I choose the local directory for ol.js after having put it there, I get the same error.
Firebug only calls the error, when using your statement:
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://t1.openseamap.org/seamark/{z}/{x}/{y}.png'
})
})
to add the seamark layer!
Last edited by SAILBOOK (2013-11-20 14:06:33)
Offline
Does your way still work, if you add this to your code:
new ol.layer.Tile({
source: new ol.source.XYZ({
url: 'http://t1.openseamap.org/seamark/{z}/{x}/{y}.png',
crossOrigin: 'null'
})
})
This solves my issue, but I still can't see the seamarks!
Even JSFiddle doesn't seem to get it working http://jsfiddle.net/J2KBC/
Last edited by SAILBOOK (2013-11-27 14:42:21)
Offline
I used 't1.openseamap.org' instead of 'tiles.openseamap.org' (like described in the wiki http://wiki.openseamap.org/wiki/De:Open … nLayers_3) and commented out 'crossOrigin'.
Tested on Firefox and Chrome. Does this run on your machine?
Offline
It makes no difference for me, if I user t1 or tiles or crossOrigin or not.
I checked it on every browser on 4 different pcs and networks.
It works in Safari always. It works in Chrome Mobile! (With crossOrigin, without crossOrigin, with t1 or tiles)
Opera, Chrome, Firefox, IE don't show it. Firebug calls Insecure Errors, if I am missing the crossOrigin property.
So I would say add "crossOrigin" since it prevents errors and works just as well, if it works at all.
From what I see it depends on the Javascript Engine being used. Chrome and Firefox changed their engine while updating the browsers.
Which Firefox and Chrome browser do you use?
This is driving me nuts...
Offline
I changed the CORS headers on server side.
Please try again. Does it work?
Offline
Yes... using t1 it finally works!!!
But crossOrigin: 'null' is necessary!
EDIT:
And they say we should use: Canvas
https://github.com/openlayers/ol3/issues/1326
Last edited by SAILBOOK (2013-11-29 07:46:14)
Offline
Pages: 1