Hi,
We would like to zoom in and center the search maps on a specific country
(NZ) by default without disabling pan.
This question has been raised a few times and we have tried the various
changes suggested with no luck.
We are on GN v2.10.2 and are using the HTML5UI.
Any help much appreciated.
Many Thanks
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Setting-search-maps-default-zoom-and-center-GN-v2-10-2-HTML5UI-tp5101963.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.
shireeb
2
Help please I am going around in circles.
We are using OSM based maps.
I have tried (in debug mode, so that the non minified files are used) adding
a center and zoom to:
MAP_OPTIONS and MAIN_MAP_OPTIONS
https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/html5ui/js/map/Settings.js#L73&L89
center : new
OpenLayers.LonLat(174.55,-41.10).transform("EPSG:4326","EPSG:900913")
And to the:
generateMaps function
https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/html5ui/js/map/MapApp.js#L72
and #L142 (may not be the right place?)
center: GeoNetwork.map.MAIN_MAP_OPTIONS.center.clone()
center: GeoNetwork.map.MAP_OPTIONS.center.clone()
I have also played around with disabling the restrictedExtent and setting
wrapDateLine to true.
Nothing has worked. Any suggestions very welcomed.
Many Thanks for your help
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Setting-search-maps-default-zoom-and-center-GN-v2-10-2-HTML5UI-tp5101963p5105688.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.
Hi,
To reply to my own post for anyone looking to do a similar thing. Note may
not be the best way to achieve but does work.
Centering search map:
Add /center: new
OpenLayers.LonLat(174.55,-41.10).transform("EPSG:4326","EPSG:900913"),
zoom : 4,/ to var geomWithMapField in SearchApp.js
(https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/html5ui/js/search/SearchApp.js#L293)
Also comment out MAP_OPTIONS restrictedExtent in Settings.js
Centering metadata view and edit mode map:
Add /center: new
OpenLayers.LonLat(174.55,-41.10).transform("EPSG:4326","EPSG:900913"),/ to
createMap options in ExtentMap.js
(https://github.com/geonetwork/core-geonetwork/blob/2.10.x/web-client/src/main/resources/apps/js/GeoNetwork/lib/GeoNetwork/map/ExtentMap.js#L118)
And also comment out the /restrictedExtent/
Regards
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Setting-search-maps-default-zoom-and-center-GN-v2-10-2-HTML5UI-tp5101963p5136805.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.
Thanks for this shireeb. I will try this solution as we face the same
problem.
Cheers,
Byron
--
View this message in context: http://osgeo-org.1560.x6.nabble.com/Setting-search-maps-default-zoom-and-center-GN-v2-10-2-HTML5UI-tp5101963p5140186.html
Sent from the GeoNetwork users mailing list archive at Nabble.com.