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

Make it possible to disable Pokemon Go map style from config #143

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Make it possible to disable Pokemon Go map style from config #143

wants to merge 3 commits into from

Conversation

BobbyWibowo
Copy link

@BobbyWibowo BobbyWibowo commented Jul 31, 2016

This will disable Pokemon Go map style only when explicitly instructed to

@RolfKoenders
Copy link
Contributor

Cool! This is only on initial load? I tried to make it a setting you can just flip on in the settings but i have an issue.. When the map gets re-drawn it seems all the items and the trainer are gone (These need to be saved somewhere in a var i assume, since new items will appear on the map) You can checkout my code here

@BobbyWibowo
Copy link
Author

@RolfKoenders Yeah, it's only on initial load. Just a simple configurable setting since someone requested for it. As for more advanced stuff, I had actually made a switch style setting in my personal build: https://github.com/BobbyWibowo/OpenPoGoWeb/commit/e4d1d449205de0d54cac0d035e87f4746b5cb99e#commitcomment-18463528.

Basically, you shouldn't redraw the map. But instead, just pass the new style setting to the existing map. The map object has a function called setOptions() which allows you to pass new options. So I simply did setOptions(style: [le' new style]), and it would change the styling without breaking anything else.

@@ -222,21 +222,22 @@ var mapView = {

},
initMap: function() {
var self = this;
var self = this,
mapStyle1 = [

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i think the constant definitions at the top is better,
and the name PokemonGoMapStyle is better than mapStyle1

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed. I used mapStyle1 because I was thinking of making multiple style options (which I already did for my forked repo), but I wasn't really paying attention when doing it so yeah, I thought that'd do.

@MaxLeiter
Copy link
Contributor

status on this?

@BobbyWibowo
Copy link
Author

@MaxLeiter Should work just fine as it is imo

@Reaver01
Copy link
Contributor

conflicts

@knowncitizen
Copy link

I've been using this for a week and a half. Aside from the merge conflicts, it works great.

Conflicts:
	config/userdata.js.example
	js/main.js
@BobbyWibowo
Copy link
Author

@Reaver01 I'm not sure if I did it right, but I guess conflicts are fixed now.

{ "featureType": "water", "stylers": [ { "visibility": "on" }, { "color": "#147dd9" } ] },
{ "featureType": "poi", "elementType": "geometry.fill", "stylers": [ { "color": "#d3ffcc" } ] },{ "elementType": "labels", "stylers": [ { "visibility": "off" } ] }
]
},
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@geminiyellow Moved the styling here.

@Reaver01
Copy link
Contributor

Reaver01 commented Aug 12, 2016

👍

Approved with PullApprove

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

Successfully merging this pull request may close these issues.

6 participants