<div dir="ltr">Yes, I noticed after I've sent it, but Eric had already answered my question.  Thanks anyway though!</div><div class="gmail_extra"><br clear="all"><div>Tim-Hinnerk Heuer<br><br>Twitter: @geekdenz<br><div>
Blog: <a href="http://www.thheuer.com/" target="_blank">http://www.thheuer.com</a></div></div>
<br><br><div class="gmail_quote">On 7 May 2013 02:52, Andreas Hocevar <span dir="ltr"><<a href="mailto:ahocevar@opengeo.org" target="_blank">ahocevar@opengeo.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
You forgot to specify the projection in the View2D settings. See<br>
<a href="http://ol3js.org/en/master/examples/wms-custom-proj.html" target="_blank">http://ol3js.org/en/master/examples/wms-custom-proj.html</a> for a working<br>
example.<br>
<br>
Also note that OL3 questions should be asked at<br>
<a href="https://groups.google.com/d/forum/ol3-dev" target="_blank">https://groups.google.com/d/forum/ol3-dev</a>.<br>
<br>
Andreas.<br>
<div class="im"><br>
On Fri, May 3, 2013 at 1:51 AM, Tim-Hinnerk Heuer <<a href="mailto:th.heuer@gmail.com">th.heuer@gmail.com</a>> wrote:<br>
</div><div><div class="h5">> Hi,<br>
><br>
> I'm wanting to include our WMS-V project into (at least) my development<br>
> version of ol3.  However, I have a couple of issues.  The main one is that I<br>
> cannot get our WMS to display.  Apparently, it is using the wrong EPSG code<br>
> (as verified by looking at the requests), even though I defined it similarly<br>
> to the custom projection example.<br>
><br>
> We are using EPSG:2193 which is the projection of our data and is not<br>
> trivial to change.<br>
><br>
> The relevant portion in the HTML is:<br>
><br>
> <script src="<a href="http://ourenvironment.scinfo.org.nz/js/OpenLayers/proj4js.js" target="_blank">http://ourenvironment.scinfo.org.nz/js/OpenLayers/proj4js.js</a>"<br>
> type="text/javascript"></script><br>
>     <script<br>
> src="<a href="http://ourenvironment.scinfo.org.nz/js/OpenLayers/defs/EPSG2193.js" target="_blank">http://ourenvironment.scinfo.org.nz/js/OpenLayers/defs/EPSG2193.js</a>"<br>
> type="text/javascript"></script><br>
>     <script src="loader.js?id=wms-v" type="text/javascript"></script><br>
><br>
> I have the following code in my example:<br>
><br>
> goog.require('ol.Attribution');<br>
> goog.require('ol.Map');<br>
> goog.require('ol.RendererHints');<br>
> goog.require('ol.View2D');<br>
> goog.require('ol.layer.ImageLayer');<br>
> goog.require('ol.projection');<br>
> goog.require('ol.source.SingleImageWMS');<br>
> goog.require('ol.source.TiledWMS');<br>
><br>
> var layers = [<br>
>   new ol.layer.TileLayer({<br>
>     source: new ol.source.TiledWMS({<br>
>       url: '<a href="http://maps.scinfo.org.nz/basemaps/wms?" target="_blank">http://maps.scinfo.org.nz/basemaps/wms?</a>',<br>
>       params: {<br>
>           'LAYERS': 'landscape_eco_painted_relief',<br>
>           'TILED': true,<br>
>           'VERSION': '1.1.1'<br>
>       },<br>
>       extent: [1000000, 4700000.0000001, 2200000, 6300000]<br>
>     })<br>
>   })<br>
> ];<br>
> var projection = ol.projection.configureProj4jsProjection({<br>
>   code: 'EPSG:2193',<br>
>   extent: [1000000, 4700000.0000001, 2200000, 6300000],<br>
>   units: 'm'<br>
> });<br>
> var map = new ol.Map({<br>
>   //renderer: ol.RendererHint.CANVAS,<br>
>   renderer: ol.RendererHint.DOM,<br>
>   projection: projection,<br>
>   layers: layers,<br>
>   target: 'map',<br>
>   view: new ol.View2D({<br>
>     center: [1600000, 5500000],<br>
>     zoom: 4<br>
>   })<br>
> });<br>
><br>
> However, it doesn't work as expected.  The requests are going to for<br>
> example:<br>
> <a href="http://maps.scinfo.org.nz/basemaps/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&LAYERS=landscape_eco_painted_relief&TILED=true&STYLES=&SRS=EPSG%3A3857&BBOX=2504688.542848654%2C5009377.085697312%2C5009377.08569731%2C7514065.628545968" target="_blank">http://maps.scinfo.org.nz/basemaps/wms?SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&FORMAT=image%2Fpng&TRANSPARENT=true&WIDTH=256&HEIGHT=256&LAYERS=landscape_eco_painted_relief&TILED=true&STYLES=&SRS=EPSG%3A3857&BBOX=2504688.542848654%2C5009377.085697312%2C5009377.08569731%2C7514065.628545968</a><br>

> which is obviously the wrong projection.<br>
><br>
> Note: When I zoom out a lot, I can see a faint hint of New Zealand, so it<br>
> seems like it could work.<br>
><br>
> Any help would be much appreciated.<br>
><br>
> Regards,<br>
> Tim<br>
><br>
> Tim-Hinnerk Heuer<br>
><br>
> Twitter: @geekdenz<br>
> Blog: <a href="http://www.thheuer.com" target="_blank">http://www.thheuer.com</a><br>
><br>
</div></div>> _______________________________________________<br>
> Dev mailing list<br>
> <a href="mailto:Dev@lists.osgeo.org">Dev@lists.osgeo.org</a><br>
> <a href="http://lists.osgeo.org/mailman/listinfo/openlayers-dev" target="_blank">http://lists.osgeo.org/mailman/listinfo/openlayers-dev</a><br>
><br>
<span class="HOEnZb"><font color="#888888"><br>
<br>
<br>
--<br>
Andreas Hocevar<br>
OpenGeo - <a href="http://opengeo.org/" target="_blank">http://opengeo.org/</a><br>
Expert service straight from the developers.<br>
</font></span></blockquote></div><br></div>