How to add a tiff file to an openlayers map without using geoserver

1,383 views
Skip to first unread message

sav...@gmail.com

unread,
Jul 15, 2016, 7:23:42 PM7/15/16
to Tethys Platform
I have a folder of tiff files saved in a folder on my local host. How can I add those as a map layer if I am using an open layers map. I don't want to upload my files to the geoserver website, I want to pull them from my local folder and display them. Here is a screenshot of where I am saving the tif files. 

swainn

unread,
Jul 18, 2016, 4:00:48 PM7/18/16
to Tethys Platform
Here is a link to an example of how to load a static image into OpenLayers:


The trick will be to set the extent for each image so that it shows up in the correct location. I don't love this example because it doesn't really show how to do that, but the principles are the same. Use the Image layer and ImageStatic source. The extent is just a JavaScript array of four numbers (e.g.):

[minX, minY, maxX, maxY]

Reply all
Reply to author
Forward
0 new messages