My re-reply to message 1 "mosaic layer not displayng" below Phil Scadden message:
--- Mer 6/3/13, [email protected] <[email protected]> ha scritto: Da: [email protected] <[email protected]> Oggetto: Users Digest, Vol 78, Issue 23 A: [email protected] Data: Mercoledì 6 marzo 2013, 22:48 Send Users mailing list submissions to [email protected] To subscribe or unsubscribe via the World Wide Web, visit http://lists.osgeo.org/mailman/listinfo/openlayers-users or, via email, send a message with subject or body 'help' to [email protected] You can reach the person managing the list at [email protected] When replying, please edit your Subject line so it is more specific than "Re: Contents of Users digest..." Today's Topics: 1. Re: mosaic layer not displayng (Phil Scadden) 2. Re: Conversion of BBox for GetFeature Request (Jerome A. Wendell) 3. Re: Conversion of BBox for GetFeature Request (Gery .) ---------------------------------------------------------------------- Message: 1 Date: Thu, 07 Mar 2013 09:02:55 +1300 From: Phil Scadden <[email protected]> To: [email protected] Subject: Re: [OpenLayers-Users] mosaic layer not displayng Message-ID: <[email protected]> Content-Type: text/plain; charset="ISO-8859-1"; format="flowed" On the geoserver layer preview, do a view source and compare with your code. You might be able to track down the issue by taking this code and gradually adding your bits. I would put my money on an issue with a disconnect between the mozaic EPSG and you the EPSG that you are using on your map. The image mozaic does not reproject on the fly so you must use the same EPGS on your map. Hi Phil, I've already tried to compare two codes, but without be able to integrate them in a working map. I'm quite beginner. I think you guessed with EPSG problem, I tried to put the imagemosaic layer in a map with the same layer's EPSG and now I can see my layer! I understood that tiles inside imagemosaic must have same EPSG, but I didn't know that it doesn't support the reprojection on the fly. I'll try to fit my code. Many thanks!! Bye bye. Francesca Notice: This email and any attachments are confidential. If received in error please destroy and immediately notify us. Do not copy or disclose the contents. ------------------------------ Message: 2 Date: Wed, 6 Mar 2013 16:38:29 -0500 From: "Jerome A. Wendell" <[email protected]> To: <[email protected]>, "'Gery .'" <[email protected]> Cc: 'OpenLayers User List' <[email protected]> Subject: Re: [OpenLayers-Users] Conversion of BBox for GetFeature Request Message-ID: <009e01ce1ab2$f65ffdf0$e31ff9d0$@com> Content-Type: text/plain; charset="utf-8" I was having a difficult time getting the code to work for a box selection, so I decided to set it up for selection on click. The click selection actually works better for my particular situation. The control is now returning features, but there seems to be a problem with adding them to the highlight layer. The code that I am using is below: var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", { styleMap: myStyles, displayInLayerSwitcher: false, isBaseLayer: false } ); OpenLayers.Control.myGetFeature = OpenLayers.Class(OpenLayers.Control.GetFeature,{ selectClick: function(evt){ var layerSRSgeo = new OpenLayers.Projection('EPSG:4326'); var baseSRSmer = new OpenLayers.Projection('EPSG:900913'); var bounds = this.pixelToBounds(evt.xy).transform(baseSRSmer,layerSRSgeo); this.request(bounds, {single: this.single}); }, CLASS_NAME: 'OpenLayers.Control.myGetFeature' }); var myControl = new OpenLayers.Control.myGetFeature({ protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer), box: false, hover: false, maxFeatures: 40, clickTolerance: 1 }); myControl.events.register("featureselected", this, function(e) { highlightLayer.addFeatures(e.features); }); myControl.events.register("featureunselected", this, function(e) { highlightLayer.removeFeatures(e.features); }); map.addControl(myControl); myControl.activate(); The error that I now get is below: I have been working on troubleshooting this issue for quite a while and have been searching for an answer. So far I have been unsuccessful in getting the selected features added to the highlight layer. Any suggestions that you might have are greatly appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130306/9beb8efe/attachment-0001.html> -------------- next part -------------- A non-text attachment was scrubbed... Name: image001.png Type: image/png Size: 3270 bytes Desc: not available URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130306/9beb8efe/attachment-0001.png> ------------------------------ Message: 3 Date: Wed, 6 Mar 2013 22:48:02 +0100 From: "Gery ." <[email protected]> To: "<[email protected]>" <[email protected]> Cc: OpenLayers User List <[email protected]> Subject: Re: [OpenLayers-Users] Conversion of BBox for GetFeature Request Message-ID: <[email protected]> Content-Type: text/plain; charset="us-ascii" Hi Jerome, Not sure here, but seems to me that the problem is the events.register, try this to see what is going on there: myControl.events.register("featureselected", this, function(e) { highlightLayer.addFeatures(e.features); console.log("THIS HAS BEEN ADDED: " + e.features); }); myControl.events.register("featureunselected", this, function(e) { highlightLayer.removeFeatures(e.features); console.log("THIS HAS BEEN DELETED: " + e.features); Try some variants inside the parentheses of each console.log call. Sent from my iBath On Mar 6, 2013, at 22:38, "Jerome A. Wendell" <[email protected]> wrote: I was having a difficult time getting the code to work for a box selection, so I decided to set it up for selection on click. The click selection actually works better for my particular situation. The control is now returning features, but there seems to be a problem with adding them to the highlight layer. The code that I am using is below: var highlightLayer = new OpenLayers.Layer.Vector("Highlighted Features", { styleMap: myStyles, displayInLayerSwitcher: false, isBaseLayer: false } ); OpenLayers.Control.myGetFeature = OpenLayers.Class(OpenLayers.Control.GetFeature,{ selectClick: function(evt){ var layerSRSgeo = new OpenLayers.Projection('EPSG:4326'); var baseSRSmer = new OpenLayers.Projection('EPSG:900913'); var bounds = this.pixelToBounds(evt.xy).transform(baseSRSmer,layerSRSgeo); this.request(bounds, {single: this.single}); }, CLASS_NAME: 'OpenLayers.Control.myGetFeature' }); var myControl = new OpenLayers.Control.myGetFeature({ protocol: OpenLayers.Protocol.WFS.fromWMSLayer(mylayer), box: false, hover: false, maxFeatures: 40, clickTolerance: 1 }); myControl.events.register("featureselected", this, function(e) { highlightLayer.addFeatures(e.features); }); myControl.events.register("featureunselected", this, function(e) { highlightLayer.removeFeatures(e.features); }); map.addControl(myControl); myControl.activate(); The error that I now get is below: <image001.png> I have been working on troubleshooting this issue for quite a while and have been searching for an answer. So far I have been unsuccessful in getting the selected features added to the highlight layer. Any suggestions that you might have are greatly appreciated. Thanks. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.osgeo.org/pipermail/openlayers-users/attachments/20130306/1d1cd42f/attachment.html> ------------------------------ _______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users End of Users Digest, Vol 78, Issue 23 *************************************
_______________________________________________ Users mailing list [email protected] http://lists.osgeo.org/mailman/listinfo/openlayers-users
