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

Export library #159

Open
kocio-pl opened this issue Aug 18, 2016 · 9 comments
Open

Export library #159

kocio-pl opened this issue Aug 18, 2016 · 9 comments
Labels

Comments

@kocio-pl
Copy link
Contributor

kocio-pl commented Aug 18, 2016

I make a lot of exports and it would be nice to have kind of named bookmarks library to easily reproduce it when the style code is changed.

@yohanboniface
Copy link
Member

Not exactly sure about your need and your workflow, but I'm using this kind of localconfig.js file that may answer:

exports.LocalConfig = function (localizer, project) {
    var map_id = 'greece',
        centers = {
            hispaniola: [-71.7325, 19.1075, 9],
            burundi: [29.9377, -3.4216, 9],
            sierraleone: [-13.2366965, 8.4732210, 9],
            chad: [16.56874, 8.68063, 9],
            mauritania: [-11.558, 19.725, 9],
            philippines: [122.190, 11.824, 9],
            jordan: [35.92350, 31.95157, 9],
            ethiopia: [38.7600, 9.0000, 12],
            idf: [2.373, 48.847, 12],
            senegal: [-17.45916, 14.70752, 12],
            lesvos: [26.3658, 39.1790, 10],
            athens: [23.7572, 37.9759, 11],
            guinea: [-11.426, 10.045, 8],
            senegal: [-14.711, 14.504, 8],
            iraq: [44.956, 33.317, 7],
            lebanon: [44.956, 33.317, 7],
            greece: [23.7572, 37.9759, 11],
        },
        dbname = {
            'lesvos': 'greece',
            'athens': 'greece',
        },
        bounds = {
            burundi: [28.9874267578125, -4.4833328616955255, 30.871582031249996, -2.284550660236957],
            lesvos: [25.776672363281254, 38.885688179036116, 26.890411376953125, 39.49132430037711],
            athens: [23.57872009277344, 37.90953361677018, 23.88427734375, 38.09836159280601],
            guinea: [-15.260009765625002, 7.1663003819031825, -7.547607421875001, 12.693932935851421],
            senegal: [-17.64, 12.25, -11.23, 16.74],
            iraq: [38.784, 29.05167, 48.90161, 37.39063],
            lebanon: [35.0415, 33.0236, 36.6614, 34.7506],
            greece: [20.083,36.058,26.8176,41.7693],
        };
    project.mml.compareUrl = 'http://{s}.tile.openstreetmap.fr/hot/{z}/{x}/{y}.png';
    localizer.where('center').then(centers[map_id]);
    if (bounds[map_id]) localizer.where('bounds').then(bounds[map_id]);

    
};

Then I just change the map_id value when I want to regenerate a map.

@kocio-pl
Copy link
Contributor Author

I wanted to store export boxes I make by hand through the UI.

@kocio-pl
Copy link
Contributor Author

Is it possible to export some area directly from CLI, just passing the bbox coordinates?

@kocio-pl
Copy link
Contributor Author

Are bounds used for defining export area bbox? It seems to me that they are not working then (even with your example), and it would be useful for me. Currently the export area is just a visible rectangle - without control buttons - and with some small margins added around.

@kocio-pl
Copy link
Contributor Author

@yohanboniface Could you paste more of your localconfig.js file? The excerpt above lacks the line(s) about using database source and I'd like to use more than one database with Kosmtik.

@yohanboniface
Copy link
Member

@kocio-pl https://gist.github.com/yohanboniface/dc95cf060e709c83fe67

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Nov 2, 2017

Thanks for the example!

I wanted to ask also how to enable Compare plugin window by default?

@yohanboniface
Copy link
Member

I wanted to ask also how to enable Compare plugin window by default?

You mean to be open when running Kosmtik? If yes, this is not possible atm. But that's certainly just a matter of adding a setting.
Also remember you have a shortcut for that: Ctrl-Alt-C.

@kocio-pl
Copy link
Contributor Author

kocio-pl commented Nov 2, 2017

You mean to be open when running Kosmtik?

Yes, that would be handy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants