Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activate the CRSSelector #1383

Open
simone-tilia opened this issue Jan 18, 2023 · 0 comments
Open

Activate the CRSSelector #1383

simone-tilia opened this issue Jan 18, 2023 · 0 comments

Comments

@simone-tilia
Copy link

I am trying to enable the "CRSSelector" following the documentation without success. Am I doing something wrong or is this feature yet to be made available in the geonode-mapstore-client?

Thank you!

_geonode_config.html:

{% extends 'geonode-mapstore-client/_geonode_config.html' %}
{% block override_local_config %}
<script>
    window.__GEONODE_CONFIG__.overrideLocalConfig = function(localConfig) {
        // Here the localConfig can be overridden and/or extended

        // If you want to add some crs you need to provide a definition and adding it in the additionalCRS property
        // Put the following lines at the first level of the localconfig
        var projection_defs = [{
            "code": "EPSG:3003",
            "def": "+proj=tmerc +lat_0=0 +lon_0=9 +k=0.9996 +x_0=1500000 +y_0=0 +ellps=intl+towgs84=-104.1,-49.1,-9.9,0.971,-2.917,0.714,-11.68 +units=m +no_defs",
            "extent": [1241482.0019, 973563.1609, 1830078.9331, 5215189.0853],
            "worldExtent": [6.6500, 8.8000, 12.0000, 47.0500]
        }]

        localConfig.projection_defs = projection_defs

        // And configure the new projection for the plugin as below:
        var crs_selector = { "name": "CRSSelector",
            "cfg": {
                "additionalCRS": {
                "EPSG:3003": { "label": "EPSG:3003" }
                },
                "filterAllowedCRS": ["EPSG:4326", "EPSG:3857"],
                "allowedRoles" : ["ADMIN", "USER", "ALL"]
            }
        }

        localConfig.plugins.map_viewer.push(crs_selector);
        localConfig.plugins.map_viewer.push({ "name": "SearchServicesConfig" });

        console.log(localConfig.plugins.map_viewer)
        
        return localConfig;
    };
</script>
{% endblock %}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant