My GIS experience is limited to having worked on several Geospatial Humanities projects. That is to say that I still struggle significantly with the technology (and terminology) in getting to my goal. I am working on moving a project from OpenLayers2 to OpenLayers3. I have a historical map served as a WMS from an Iowa State ArcServer that is in EPSG:26915 projection. The following code is what I use to successfully display the map in OpenLayers2
var map;function init() { map = new OpenLayers.Map('map',{ projection:'EPSG:26915', maxExtent: new OpenLayers.Bounds(202159,4470000,737457.523439407,4822691.7712555), fractionalZoom: true }); var wms = new OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://ags.gis.iastate.edu/arcgisserver/services/Ortho/andreas/ImageServer/WMSServer', {layers: 'basic'}, {isBaseLayer: true }, {} ); map.addLayer(wms); if (!map.getCenter()){ map.zoomToMaxExtent(); }}I have a number of unsuccessful attempts to display this using OpenLayers3, trying to piece together what I need from the ol3 examples and documentation.Here is my most recent unsuccessful attempt
var map; function init() { var andreas_url = 'http://ags.gis.iastate.edu/arcgisserver/services/Ortho/andreas/ImageServer/WMSServer'; var andreas_extent = [202073.808723, 4470598.397186, 736849.210393, 4822673.786539] var andreas_projection = new ol.proj.Projection({ code: 'EPSG:26915', // The extent is used to determine zoom level 0. Recommended values for a // projection's validity extent can be found at http://epsg.io/. extent: andreas_extent, units: 'm' }); ol.proj.addProjection(andreas_projection); var andreas_view = new ol.View ({ projection: andreas_projection, center: [469163,4653689], zoom:1 }); map = new ol.Map({ target:'map_container', renderer:'canvas', view: andreas_view }) var andreas_layer = new ol.layer.Tile({ source: new ol.source.ImageWMS({ url: andreas_url, params:{ 'LAYERS':'basic', 'TILED':true } }) }); map.addLayer(andreas_layer);}The WMS Capabilities sheet for this map is here:http://ags.gis.iastate.edu/arcgisse...mageServer/WMSServer?Request=GetCapabilities&
Can anybody see what I might be doing wrong, or does anybody have a good resource for learning about projections in OL3?
Thanks for any help!
أكثر...
var map;function init() { map = new OpenLayers.Map('map',{ projection:'EPSG:26915', maxExtent: new OpenLayers.Bounds(202159,4470000,737457.523439407,4822691.7712555), fractionalZoom: true }); var wms = new OpenLayers.Layer.WMS( 'OpenLayers WMS', 'http://ags.gis.iastate.edu/arcgisserver/services/Ortho/andreas/ImageServer/WMSServer', {layers: 'basic'}, {isBaseLayer: true }, {} ); map.addLayer(wms); if (!map.getCenter()){ map.zoomToMaxExtent(); }}I have a number of unsuccessful attempts to display this using OpenLayers3, trying to piece together what I need from the ol3 examples and documentation.Here is my most recent unsuccessful attempt
var map; function init() { var andreas_url = 'http://ags.gis.iastate.edu/arcgisserver/services/Ortho/andreas/ImageServer/WMSServer'; var andreas_extent = [202073.808723, 4470598.397186, 736849.210393, 4822673.786539] var andreas_projection = new ol.proj.Projection({ code: 'EPSG:26915', // The extent is used to determine zoom level 0. Recommended values for a // projection's validity extent can be found at http://epsg.io/. extent: andreas_extent, units: 'm' }); ol.proj.addProjection(andreas_projection); var andreas_view = new ol.View ({ projection: andreas_projection, center: [469163,4653689], zoom:1 }); map = new ol.Map({ target:'map_container', renderer:'canvas', view: andreas_view }) var andreas_layer = new ol.layer.Tile({ source: new ol.source.ImageWMS({ url: andreas_url, params:{ 'LAYERS':'basic', 'TILED':true } }) }); map.addLayer(andreas_layer);}The WMS Capabilities sheet for this map is here:http://ags.gis.iastate.edu/arcgisse...mageServer/WMSServer?Request=GetCapabilities&
Can anybody see what I might be doing wrong, or does anybody have a good resource for learning about projections in OL3?
Thanks for any help!
أكثر...