Yes that worked, thanks for your help.
I now have geonetwork starting up over Nz and zoomed to the level i want.
···
On Wed, Sep 2, 2015 at 8:08 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
Yes, delete the code or put it in comment.
Take care of th ‘;’ as well
On Wed, Sep 2, 2015 at 6:06 AM, Alginnon Games <upploadds@anonymised.com> wrote:
Hi florent,
Thanks for that, do you mean to alter like this
// Load the context defined in the configuration
viewerSettings.defaultContext = ‘’
// viewerSettings.mapConfig.viewerMap ||
// ‘…/…/…/map/config-viewer.xml’
;
thanks for your help with this
cheers
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492
On Tue, Sep 1, 2015 at 11:26 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
Well if you can’t make the context working (it surely should), you still have the option to use no context and set manually settings in config.js.
set viewerSettings.defaultContext to undefined
then see code below
https://github.com/geonetwork/core-geonetwork/blob/3.0.x/web-ui/src/main/resources/catalog/views/default/config.js#L60
On Tue, Sep 1, 2015 at 6:57 AM, Alginnon Games <upploadds@anonymised.com> wrote:
Hi Florent,
Same as before nothing seems to make a difference.
I have followed through with debug and stepping through code and the map extents seem to populate from within the node.js
Has anyone else been able to set a starting location in geonet 3.0 and if so how did you achieve it, if you don’t mind sharing.
I can generally edit javascript code ok if i know that im in the correct function etc, but the amount of js and functions within the latest iteration of geonet is somewhat daunting.
Is there any developer documentation available that outlines the interactions between the functions of the geonet web app.
cheers
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492
On Tue, Aug 18, 2015 at 7:52 PM, Peter <upploadds@anonymised.com> wrote:
Hi,
The config-viewer.xml file is as it came within the war file. I’ve only changed the bbox location. So maybe if I add the server element into the file as per your example it may work.
I’ll give it a try.
Thanks for the suggestion
From: Florent Gravin
Sent: 18/08/2015 7:33 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Changing the initial map zoom levelandlocation
Hi,
So it does “nothing” just because your context is not well formatted i guess.
You missed the “server” element, see an example above
<ows-context:Layer queryable=“false” name=“TEMP” hidden=“true” opacity=“1”>
<ows:Title xmlns:ows=“http://www.opengis.net/ows”>Coriolis ncWMS</ows:Title>
<ows-context:Server service=“urn:ogc:serviceType:WMS”>
<ows-context:OnlineResource xmlns:xlink=“http://www.w3.org/1999/xlink” xlink:href=“http://tds0.ifremer.fr/thredds/wms/CORIOLIS-GLOBAL-CORA04.0-OBS_FULL_TIME_SERIE?”/>
</ows-context:Server>
ows-context:StyleList/
</ows-context:Layer>
[The entire original message is not included.]
On Tue, Aug 18, 2015 at 12:22 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:
Hi Florent,
Ok i have done some digging with the Chrome dev tools and have a couple of errors constantly.
The first error is on page loading.
TypeError: Cannot read property ‘0’ of undefined
at module.service.loadContext (http://server_name:8080/geonetwork/catalog/components/viewer/owscontext/OwsContextService.js:130:40)
at module.directive.link (http://server_name:8080/geonetwork/catalog/components/viewer/owscontext/OwsContextDirective.js:118:33)
at http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:8135:44
at invokeLinkFn (http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:8141:9)
at nodeLinkFn (http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:7653:11)
at http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:7884:13
at processQueue (http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:13071:27)
at http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:13087:27
at Scope.$get.Scope.$eval (http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:14287:28)
at Scope.$get.Scope.$digest (http://server_name:8080/geonetwork/catalog/lib/angular/angular.js:14103:31)
(anonymous function) @ angular.js:11496$get @ angular.js:8479invokeLinkFn @ angular.js:8143nodeLinkFn @ angular.js:7653(anonymous function) @ angular.js:7884processQueue @ angular.js:13071(anonymous function) @ angular.js:13087$get.Scope.$eval @ angular.js:14287$get.Scope.$digest @ angular.js:14103$get.Scope.$apply @ angular.js:14391done @ angular.js:9567completeRequest @ angular.js:9752requestLoaded @ angular.js:9695
angular.js:9732 XHR finished loading: GET “
http://server_name:8080/geonetwork/catalog/components/viewer/draw/partials/draw.html”.(anonymous function) @ angular.js:9732sendReq @ angular.js:9536$get.serverRequest @ angular.js:9253processQueue @ angular.js:13071(anonymous function) @ angular.js:13087$get.Scope.$eval @ angular.js:14287$get.Scope.$digest @ angular.js:14103$get.Scope.$apply @ angular.js:14391done @ angular.js:9567completeRequest @ angular.js:9752requestLoaded @ angular.js:9695
which highlights this section in OwsContextService.js
} else {
var server = layer.server[0];
if (server.service == ‘urn:ogc:serviceType:WMS’) {
self.createLayer(layer, map);
}
And the second error which occurs when i click on load default map
Error: Could not find element declaration for the element [{http://www.w3.org/1999/xhtml}html].
at Object.Jsonix.Context.Unmarshaller.Jsonix.Class.unmarshalElementNode (Jsonix-min.js:2147)
at Object.Jsonix.Context.Unmarshaller.Jsonix.Class.unmarshalDocument (Jsonix-min.js:2142)
at Object.Jsonix.Context.Unmarshaller.Jsonix.Class.unmarshalString (Jsonix-min.js:2121)
at module.service.loadContext (OwsContextService.js:69)
at OwsContextService.js:185
at angular.js:9278
at processQueue (angular.js:13071)
at angular.js:13087
at Scope.$get.Scope.$eval (angular.js:14287)
at Scope.$get.Scope.$digest (angular.js:14103)(anonymous function) @ angular.js:11496$get @ angular.js:8479processQueue @ angular.js:13079(anonymous function) @ angular.js:13087$get.Scope.$eval @ angular.js:14287$get.Scope.$digest @ angular.js:14103$get.Scope.$apply @ angular.js:14391done @ angular.js:9567completeRequest @ angular.js:9752requestLoaded @ angular.js:9695
any ideas florent
On Tue, Aug 18, 2015 at 9:48 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:
Hi,
Thanks, when i select load default map it doesn’t seem to do anything.
Im pretty certain its not doing anything, maybe i need to report this as a bug.
cheers
On Mon, Aug 17, 2015 at 9:19 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
There is no option, it just loads the file pointed by your config.
Try “load map” instead if you want to pick a file up
On Mon, Aug 17, 2015 at 11:18 AM, Peter <upploadds@anonymised.com> wrote:
Hi,
The load default map button doesnt seem to function. No option comes up to load a map.
Cheers
From: Florent Gravin
Sent: 17/08/2015 9:07 p.m.
To: Peter Van Dijk
Cc: geonetwork-devel@lists.sourceforge.net
Subject: Re: [GeoNetwork-devel] Changing the initial map zoom level andlocation
Hi,
The context is stored in local storage. Try to load yours from map “Maps tab / load default map”.
On Mon, Aug 17, 2015 at 4:21 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:
Hi Florent,
I still havn’t had any luck changing the startup and zoom level of the initial map view , i have tested using the config-viewer , config-viewer-osm and map-viewer_demis.wmc and it still makes no difference what settings i have in the files. the initial map on startup always seems to default to the full osm view.
im pretty much stumped at the moment
cheers
On Thu, Jul 30, 2015 at 8:11 PM, Florent Gravin <florent.gravin@anonymised.com.> wrote:
Hi,
Well the load default map button should load the map in config-viewer.xml by default. The context file may have been over written in your admin settings ?
I suggest you to debug a bit, add ?debug flag before the # of your url, and look into
https://github.com/geonetwork/core-geonetwork/blob/develop/web-ui/src/main/resources/catalog/components/viewer/owscontext/OwsContextDirective.js#L92
watch the value of gnViewerSettings.defaultContext to tell what context file is used.
On Thu, Jul 30, 2015 at 2:14 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:
Hi Florent,
I have zoomed to the location i need to be the default, saved the map, manually backed up the config-viewer.xml
and replaced the contents with the contents of the saved map.
Cleared browser caches and restarted tomcat.
(i find that the map button load default map doesn’t do anything) save map and load map work ok.
The map is still the same, maybe other settings or load order is taking preference.?
Any other ideas on what to look at?
cheers
Extra note:
Another thing to note that may be a bug or an issue with the save map function somewhere.
When you are zoomed out or just loaded the map and use the save map, the name of the file includes center coordinates in epsg 4326 and the contents in epsg 3857.
When you are zoomed in close to a country (able to see roads etc) the name of the file center coordinates are in epsg 3857 and the contents are epsg 3857.
its just a little thing but could be an indicator for some thing else.
–
On Wed, Jul 29, 2015 at 9:44 PM, Florent Gravin <florent.gravin@anonymised.com> wrote:
Hi,
Maybe you might want to change the OWS context that is used.
https://github.com/geonetwork/core-geonetwork/blob/develop/web/src/main/webapp/WEB-INF/data/data/resources/map/config-viewer.xml
Change this file and load it in your map in map/maps panel/load default map.
If you don’t know how to set your center ine this file, just go in map, zoom on the right location, then save your context with #map/maps panel/save map and replace the default one with this one.
On Wed, Jul 29, 2015 at 5:34 AM, Peter Van Dijk <upploadds@anonymised.com> wrote:
Hi,
I would like to set the initial startup zoom level and map center for the mapview.
But cannot find the location to do this.
The closest i have gotten is to be able to set the map center within the code
below from mapdirective.js
The zoom level for this has no effect however.
Is there a set location i change the initial zoom level.
----------------------line 126 - 129 --------------------
renderer: ‘canvas’,
view: new ol.View({
center: [171.6476, -43.8207],
projection: scope.projs.map,
zoom: 9
})
cheers
GeoNetwork-devel mailing list
GeoNetwork-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geonetwork-devel
GeoNetwork OpenSource is maintained at http://sourceforge.net/projects/geonetwork
–
camptocamp
INNOVATIVE SOLUTIONS
BY OPEN SOURCE EXPERTS
Florent Gravin
0479444492