0

I have BoundlessGeo's OpenGeo Suite (Geoserver,PostGIS,GeoWebCache,GeoExplorer) installed, and love the web functionality of GeoExplorer, but need my maps to zoom in a few steps further.

So far the only way I can think would be to edit the GeoExplorer.js file (which appears a min/concat of Ext and OpenLayers) to change the default zoom levels, but that seems like a bad way to go.

Any ideas? Is this functionality that should be added to GeoExplorer? Perhaps I could add zoom levels after the map is loaded?

1

You should be able to pass in a set (array) of resolutions in the map section of the config. This is part of the HTML template, see:

https://github.com/boundlessgeo/suite/blob/master/geoexplorer/app/templates/composer.html#L64

GeoExplorer uses gxp.Viewer which will take care of using the passed in resolutions, see:

https://github.com/boundlessgeo/gxp/blob/master/src/script/widgets/Viewer.js#L498

2

I was also looking at this trying to figure out how to make it work with the composer that comes standard with OpenGeoSuite. If you are in windows and aren't quite ready to create an app with the Boundless SDK, you can still change some of the configurations through the geoexplorer script. If you are in windows the default file location is:

 C:\Program Files (x86)\Boundless\OpenGeo\jetty\webapps\geoexplorer\WEB-INF\app\static\script\GeoExplorer.js     

open in notepad++ or other text editor Then look in line 925 for:

 Bounds.fromArray(b.restrictedExtent),numZoomLevels:b.numZoomLevels||20             

Change the 20 to 22 or higher if you want a higher zoom level (though most basemap layers such as google go to 22 at the highest, but if you have your own layer through geoserver or another source a higher zoom level can be beneficial for higher resolution data.

0

Thanks, here is the code to change de zoom level. I changed to 26. Just change the name in the file: C:\Program Files (x86)\Boundless\OpenGeo\jetty\webapps\geoexplorer\WEB-INF\app\static\script\ GeoExplorer.js

You can rename the file GeoExplorer-debug.js to GeoExplorer.js and edit it.

this.mapPanel = Ext.ComponentMgr.create(Ext.applyIf({
        xtype: config.xtype || "gx_mappanel",
        map: Ext.applyIf({
            theme: mapConfig.theme || null,
            controls: mapConfig.controls || [
                new OpenLayers.Control.Navigation({
                    zoomWheelOptions: {interval: 250},
                    dragPanOptions: {enableKinetic: true}
                }),
                new OpenLayers.Control.PanPanel(),
                new OpenLayers.Control.ZoomPanel(),
                new OpenLayers.Control.Attribution()
            ],
            maxExtent: mapConfig.maxExtent && OpenLayers.Bounds.fromArray(mapConfig.maxExtent),
            restrictedExtent: mapConfig.restrictedExtent && OpenLayers.Bounds.fromArray(mapConfig.restrictedExtent),
            numZoomLevels: mapConfig.numZoomLevels || 26
        }, mapConfig),
        center: config.center && new OpenLayers.LonLat(config.center[0], config.center[1]),
        resolutions: config.resolutions,
        forceInitialExtent: true,
        layers: [new OpenLayers.Layer(null, baseLayerConfig)],
        items: this.mapItems,
        plugins: this.mapPlugins,
        tbar: config.tbar || new Ext.Toolbar({
            hidden: true
        })
    }, config));

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.