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

Different map baselayer than ESRI #25

Closed
nitinthewiz opened this issue Mar 14, 2018 · 9 comments
Closed

Different map baselayer than ESRI #25

nitinthewiz opened this issue Mar 14, 2018 · 9 comments

Comments

@nitinthewiz
Copy link

Hey Aaron,

I'm a little tired of the ESRI style map as it feels cluttered and at the same time, doesn't have enough information (such as building/business names). I favor the mapbox street map and right now, I sometimes go into the console and switch over to the street map using the following commands -

map.removeLayer(layer);
layer = new L.TileLayer('https://a.tiles.mapbox.com/v4/mapbox.streets-basic/{z}/{x}/{y}.png?access_token=<my_access_token>').addTo(map);

This is obviously not ideal. I'm moving to permanently change the map in the map.js file (for my use), but I'm wondering if this would be a good setting to add to the Settings page. There are a few moving parts to this, so I wanted to discuss this with you -

  1. It needs to have a few available options, such as the default Topographical map, Mapbox Street Map, OSM maps, etc.
  2. The option needs to be saved in the database
  3. map.js needs to use the value from the database somehow
  4. For Mapbox, the access_token also needs to be saved

Do you want me to take a crack at it? I could submit a pull request if/when I get the code ready.

@aaronpk
Copy link
Owner

aaronpk commented Mar 14, 2018

Is this something you'd want to change per database? Or would it be something on the whole installation? An easier version of this could be to use the .env file to hold the settings, that way you could avoid needing to make a UI to manage it.

@nitinthewiz
Copy link
Author

Ah, yes, using the .env file makes sense. I've got only one database and so it doesn't matter. But I could see someone using different databases for different purposes (one for day trips, another for hiking?) and so need different maps.

But as I said, while writing it, I decided to move permanently to the mapbox tiles and have made the change on my install.

Say, what and how do you use different databases? Is your installation used by different people?

@aaronpk
Copy link
Owner

aaronpk commented Mar 15, 2018

I have a primary database for my GPS logs, and I have another big one for all my weather data. Every 5 minutes a script checks my current location, looks up the weather at that location, and writes it to that database. That’s how the little weather info appears on my posts. I’ve also used other databases for testing the app so I can write to a test DB, or storing other home automation data.

@nitinthewiz
Copy link
Author

@aaronpk could you share this script that adds the weather data? I'd like to add that to my setup.

@aaronpk
Copy link
Owner

aaronpk commented Jul 3, 2018

Sure thing! Here's the script I use, you'll need to fill in the three API keys at the top of the file, and of course replace compass.p3k.io with your own domain. https://aaronparecki.com/2018/07/03/7/

@nitinthewiz
Copy link
Author

Thanks for the file! I'll have to modify it a bit as it seems that May 2018 was the last when Wunderground provided free API keys. You must be grandfathered in, or about to be kicked off their systems...

@aaronpk
Copy link
Owner

aaronpk commented Jul 7, 2018

oh no! That's no good, I hope I don't lose access to the API!

@nitinthewiz
Copy link
Author

It's not that difficult to change to Dark Sky, it seems 😊
I can upload the code to gist in a bit.

Maybe you can comment on it because I had to pull all the new metrics the app is tracking...

@nitinthewiz
Copy link
Author

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

2 participants