From: Edwin C. <com...@gm...> - 2010-03-13 16:53:37
|
Hi Greg, I added a setResolutions method to LayerOptions and MapOptions in trunk, you can check out the code anonymously. Greetings, Edwin On 13 March 2010 16:27, Edwin Commandeur <com...@gm...> wrote: > Hi Greg, > > You need to set the resolutions on the Map and Layer, however there > are no methods for that yet. If I find some time I can add them and > send you an updated jar, or you can check out the source and add them. > > Greetings, > Edwin > > On 13 March 2010 00:11, Greg Machala <Gre...@no...> wrote: >> I was able to trace the url and this is the url: >> http://radarcache.srh.noaa.gov/tilecache/tilecache.py?FORMAT=image% >> 2Fpng&LAYERS=radar_slice&TRANSPARENT=true&RADAR=NAT&LEVEL=NET&TILED=false&TIME=2010-03-12T16%3A05&SERVICE=WMS&VERSION=1.1.1&REQUEST=GetMap&STYLES=&EXCEPTIONS=application%2Fvnd.ogc.se_inimage&_OLSALT=0.024564905486804567&BBOX=-87.439537644386,33.015840291977,-86.842373371124,33.613004565239&WIDTH=256&HEIGHT=256 >> >> This is the error: >> An error occurred: can't find resolution index for 0.003906. Available >> resolutions are: >> [156543.03392804062, 78271.516964020309, 39135.758482010155, 19567.879241005077, 9783.9396205025387, 4891.9698102512693, 2445.9849051256347, 1222.9924525628173, 611.49622628140867, 305.74811314070433, 152.87405657035217, 76.437028285176083, 38.218514142588042, 19.109257071294021, 9.5546285356470104, 4.7773142678235052, 2.3886571339117526, 1.1943285669558763, 0.59716428347793815, 0.29858214173896908] >> >> I was reading this in the source code: >> * Somehow this is not an API property in OL, but it seems it would >> * make sense as an API property and it is well documented: >> * </p> >> * <p> >> * For a base layer that supports it, allow the map resolution >> * to be set to a value between one of the values in the resolutions >> * array. Default is false. >> * >> * When fractionalZoom is set to true, it is possible to zoom to >> * an arbitrary extent. This requires a base layer from a source >> * that supports requests for arbitrary extents (i.e. not cached >> * tiles on a regular lattice). This means that fractionalZoom >> * will not work with commercial layers (Google, Yahoo, VE), layers >> * using TileCache, or any other pre-cached data sources. >> * >> * If you are using fractionalZoom, then you should also use >> * getResolutionForZoom instead of layer.resolutions[zoom] as the >> * former works for non-integer zoom levels. >> >> I tried turning fractionalZoom off and it still didn't work. I am following >> what this says that you need to create 16 resolutions in an array and only >> use those but I don't see where this array is created and injected into >> openLayers. >> >> Do you have any ideas? >> >> Greg >> >> On Fri, 2010-03-12 at 19:36 +0100, Edwin Commandeur wrote: >>> hi Greg, >>> >>> In the code below you create a correct JSObject, but do not set it on >>> the WMSParams with setJSObject. >>> >>> You can check on the WMSParams if the format and layers are set >>> correctly after setting the JSObject. >>> >>> The best way to see the URL is to debug the GWT app in the browser >>> with Firebug, which is easiest if you are on GWT 2.0. >>> >>> Greetings, >>> Edwin >>> >>> On 12 March 2010 18:33, Greg Machala <Gre...@no...> wrote: >>> > Yes it works in javascript I got the parameters from a working >>> > javascript project. I changed it to the following and just get >>> > broken image of pink tiles. Is there some way to print to console >>> > the url openlayers is generating? >>> > >>> > private Layer getRadarLayer() { >>> > WMSOptions wmsOptions = new WMSOptions(); >>> > wmsOptions.setSingleTile(false); >>> > wmsOptions.setIsBaseLayer(false); >>> > wmsOptions.setBuffer(0); >>> > WMSParams wmsParams = new WMSParams(); >>> > JSObject jsObject = JSObject.createJSObject(); >>> > jsObject.setProperty("format","image/png"); >>> > jsObject.setProperty("layers", "radar_slice"); >>> > jsObject.setProperty("transparent", "true"); >>> > jsObject.setProperty("radar", "NAT"); >>> > jsObject.setProperty("level", "NET"); >>> > jsObject.setProperty("tiled", "true"); >>> > jsObject.setProperty("time", "2010-03-11T17:00"); >>> > >>> > return new WMS("Radar", WMS_RADAR_URL, wmsParams, wmsOptions); >>> > } >>> > >>> > >>> > >>> > On Fri, 2010-03-12 at 18:23 +0100, Edwin Commandeur wrote: >>> >> Hi Greg, >>> >> >>> >> By setting the JSObject on wmsParams2 you let wmsParams2 wrap the >>> >> JSObject you create, overriding the JSObject it created internally on >>> >> which the layers, tranparancy etc were set. >>> >> >>> >> I think it should work if you set all properties on a newly created >>> >> JSObject, including layers, transparency etc. >>> >> >>> >> Did you try if it works in Javascript? >>> >> >>> >> Greetings, >>> >> Edwin >>> >> >>> >> On 12 March 2010 17:33, Greg Machala <Gre...@no...> wrote: >>> >> > Hello, >>> >> > >>> >> > I am new to OpenLayers GWT and really like it a lot. >>> >> > I am working with maps on a local GeoServer and it >>> >> > works great. I am running into difficulty trying to >>> >> > load a WMS radar image from this site: >>> >> > public static final String WMS_RADAR_URL = "http://radarcache.srh.noaa.gov/tilecache/tilecache.py"; >>> >> > >>> >> > using this method: >>> >> > >>> >> > private Layer getRadarLayer() { >>> >> > WMSOptions wmsOptions = new WMSOptions(); >>> >> > wmsOptions.setSingleTile(false); >>> >> > wmsOptions.setIsBaseLayer(false); >>> >> > wmsOptions.setBuffer(0); >>> >> > WMSParams wmsParams2 = new WMSParams(); >>> >> > wmsParams2.setLayers("radar_slice"); >>> >> > wmsParams2.setIsTransparent(true); >>> >> > wmsParams2.setFormat("image/png"); >>> >> > JSObject jsObject = JSObject.createJSObject(); >>> >> > jsObject.setProperty("radar", "NAT"); >>> >> > jsObject.setProperty("level", "NET"); >>> >> > jsObject.setProperty("tiled", "true"); >>> >> > jsObject.setProperty("time", "2010-03-11T17:00"); >>> >> > wmsParams2.setJSObject(jsObject); >>> >> > return new WMS("Radar", WMS_RADAR_URL, wmsParams2, wmsOptions); >>> >> > } >>> >> > >>> >> > The tilecache.py needs the variables set for radar=,level=,time= to grab the right image >>> >> > am I doing this correctly? >>> >> > >>> >> > Thanks, >>> >> > >>> >> > Greg Machala >>> >> > ITO-National Weather Service-BHM,AL >>> >> > >>> >> > >>> >> > ------------------------------------------------------------------------------ >>> >> > Download Intel® Parallel Studio Eval >>> >> > Try the new software tools for yourself. Speed compiling, find bugs >>> >> > proactively, and fine-tune applications for parallel performance. >>> >> > See why Intel Parallel Studio got high marks during beta. >>> >> > http://p.sf.net/sfu/intel-sw-dev >>> >> > _______________________________________________ >>> >> > Gwt-openlayers-users mailing list >>> >> > Gwt...@li... >>> >> > https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>> >> > >>> >> >>> >> ------------------------------------------------------------------------------ >>> >> Download Intel® Parallel Studio Eval >>> >> Try the new software tools for yourself. Speed compiling, find bugs >>> >> proactively, and fine-tune applications for parallel performance. >>> >> See why Intel Parallel Studio got high marks during beta. >>> >> http://p.sf.net/sfu/intel-sw-dev >>> >> _______________________________________________ >>> >> Gwt-openlayers-users mailing list >>> >> Gwt...@li... >>> >> https://lists.sourceforge.net/lists/listinfo/gwt-openlayers-users >>> > >>> > >> >> > |