Hi Garey,
I’ve done some of this already, but it is untested since I didn’t have any sample data.
Take a look at mapDiv.js:
| // a place to store references to external windows and associated data |
| this.externalPreviewWindows = new OpenGeoportal.ExternalPreviewWindows(); |
|
|
| this.openImageCollectionUnGeoReferenced = function(model) { |
| // this model has attributes to facilitate preview of ImageCollection |
| // UnGeoreferenced layers |
| var newModel = new OpenGeoportal.Models.ImageCollectionUnGeoreferenced( |
| model.attributes); |
| // adding the model opens the external window |
| this.externalPreviewWindows.add(newModel); |
| }; |
|
|
| this.closeImageCollectionUnGeoReferenced = function(layerId) { |
| var model = this.externalPreviewWindows.findWhere({ |
| LayerId : layerId |
| }); |
| this.externalPreviewWindows.remove(model); |
| }; |
|
|
| /** |
| * |
| * @param {string} |
| * previewType a key that should match up with a "type" property |
| * @param {string} |
| * functionType either "onHandler" for the function that turns on |
| * a layer preview or "offHandler" for the function that turns |
| * off a layer preview |
| * @returns {Function} a function that turns on or off a layer depending on |
| * passed type |
| */ |
| this.getPreviewMethod = function(previewType, functionType) { |
| var previewMethods = [ { |
| type : "imagecollection", |
| onHandler : this.openImageCollectionUnGeoReferenced, |
| offHandler : this.closeImageCollectionUnGeoReferenced |
| }, {... |
in models/externalPreviewWindowsCollection.js there is a listener that calls the ‘openWindow’ function when a layer model from the above code is added to the collection. Also, when the model is added to the collection, it is converted to ‘OpenGeoportal.Models.ImageCollectionUnGeoreferenced’ which has some additional properties needed for the preview. The url to the ‘gss’ servlet will need to be updated if you’ve changed it (note: this url should probably be in the solr location field to be more self contained…otherwise everyone will have to modify their code any time this url changes, instead of just reharvesting from you). I don’t recall if already does or not, but the gss servlet will need to serve either ‘jsonp’ or have CORS enabled in order for other OGP instances to use your ungeoreferenced layers.
unGeoreferencedWindow.js contains the javascript needed by the opened browser window. This code is similar, if not identical, to code that you sent me before.
Lastly, WEB-INF/views/ungeoreferenced.jsp contains the html for the opened browser window, which is also similar, if not identical to what you sent me.
Let me know how it goes!
thanks,
Chris