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

Selectable search marker icon #739

Merged
merged 21 commits into from
Aug 18, 2016
Merged

Selectable search marker icon #739

merged 21 commits into from
Aug 18, 2016

Conversation

Becold
Copy link
Contributor

@Becold Becold commented Aug 16, 2016

Description

The user can change the icon marker if he dont like it.
Changed the default icon marker to the Google's one.

The marker styles are located in static/data/searchmarkerstyle.json

Motivation and Context

A lot of people hate the new Ash marker from commit 8080e8e
And https://github.com/PokemonGoMap/PokemonGo-Map/issues/697 asked my "Why is there a Mario on the map ? lol"

How Has This Been Tested ?

Deleting my cache and my localstorage between each test.
See screenshots

Screenshots :

On the front-end :
image

image

image

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.

@invisiblek
Copy link
Contributor

I think it makes more sense for this to be handled on the front end. Users could select what they want and store their setting in localStorage.

@Studio-XP
Copy link
Contributor

Yes, I agree that it should be handled by the front end. I've started putting something together last night in map.js. I'll put it up later on when I get off work

@Becold
Copy link
Contributor Author

Becold commented Aug 16, 2016

Should I had the feature on the frontend (and keep it on the backend too)
Or I close this PR and only do something on the frontend ?

@jnovack
Copy link
Contributor

jnovack commented Aug 16, 2016

Front-end only please.

@Becold
Copy link
Contributor Author

Becold commented Aug 16, 2016

I'm done with the front-end.
The back-end is good to keep. It's by default on ash (as it is now).

@Becold Becold changed the title Optional icon marker Selectable icon marker Aug 16, 2016
@Albert62
Copy link

Albert62 commented Aug 16, 2016

Here is my icon:
marker_icon

Preview:
preview

Enjoy.

@Moussa
Copy link

Moussa commented Aug 16, 2016

Add an argument to change the original icon marker.

The original icon marker wasn't invisible though?

@Becold
Copy link
Contributor Author

Becold commented Aug 16, 2016

@Moussa I'll add the default icon (from Google) to the list.
image

@invisiblek Which icon do I set as default? Ash or Google's icon marker ?

@invisiblek
Copy link
Contributor

probably google's as the default

…-end/python stuff and keeped only the front-end/UI stuff.
@Becold
Copy link
Contributor Author

Becold commented Aug 16, 2016

I edited the original PR.
Removed all the python/backend stuff (the argument -om is gone) and Keeped all the front-end/UI stuff (with the list).
Ready to be merged!

<option value="default">Default</option>
<option value="ash">Ash</option>
<option value="none">None</option>
</select>
Copy link
Contributor

Choose a reason for hiding this comment

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

should be indented the same as line 215

@Studio-XP
Copy link
Contributor

Studio-XP commented Aug 16, 2016

Would it be better to load the values from a javascript object and load them into the select container? For example:

var searchMarkerStyles = {
  google: {
    name: 'Default Google Marker',
    icon: '',
  },
  red: {
    name: 'Red',
    icon: 'static/markers/red.gif',
  },
  red_animated: {
    name: 'Red (Animated)',
    icon: 'static/markers/red_animated.gif',
  },
  none: {
    name: 'Hidden',
    icon: 'static/markers/blank.gif',
  }
}

and update the marker on the fly with

function updateSearchMarker (style) {
  if (style in searchMarkerStyles) {
    searchMarker.setIcon(searchMarkerStyles[style].icon)
    Store.set('searchMarkerStyle', style)
  }
  return searchMarker
}

btw, I added a variable searchMarker and renamed marker to searchMarker in createSearchMarker()

@Becold
Copy link
Contributor Author

Becold commented Aug 17, 2016

@Studio-XP Done. But gif aren't working as icon marker and I dont know why... (Rip animated Red)

@Studio-XP
Copy link
Contributor

Studio-XP commented Aug 17, 2016

Always glad to help. Btw, noticed this

'searchMarkerStyle': {
    default: 'default',
    type: StoreTypes.String

should be this

'searchMarkerStyle': {
    default: 'google',
    type: StoreTypes.String

@chuyskywalker
Copy link
Contributor

This looks fantastic.

@hklcf
Copy link
Contributor

hklcf commented Aug 17, 2016

great

@Becold Becold changed the title Selectable icon marker Selectable search marker icon Aug 17, 2016
@Studio-XP
Copy link
Contributor

I can redo the pokeball as an 8 bit too when I get home if you want. Looks blurry

@Becold
Copy link
Contributor Author

Becold commented Aug 17, 2016

Up to you @Studio-XP

@Studio-XP
Copy link
Contributor

As promised
pokeball

@Becold
Copy link
Contributor Author

Becold commented Aug 17, 2016

Ready to be merged, I guess

@chuyskywalker chuyskywalker merged commit 7729aab into RocketMap:develop Aug 18, 2016
@rrbailey89
Copy link
Contributor

@Becold on mobile the drop down menu is very tiny and can't be selected.

@Studio-XP
Copy link
Contributor

Studio-XP commented Aug 18, 2016

Not sure why it's like that. Should be like the rest of the menus. Uses the same code. It's working as expected on chrome for Android.

Sorry for the large file, not home and can't resize
20160818_064320

@Becold
Copy link
Contributor Author

Becold commented Aug 18, 2016

@rrbailey89 Did you run grunt build and clear the cache ?

@Studio-XP
Copy link
Contributor

Yeah, it almost sounds like grunt didn't build the search markers json file in dist/data. Are there any options?

If you're adding it without downloading it from github, you can technically just copy that file to that location

@rrbailey89
Copy link
Contributor

@Becold @Studio-XP it works perfectly on my desktop. Sorryou I'm not running the server atm to show the screen shot however on mobile for me the dropdown menu is present but it's width is shrunk down and when tapped displays no list

@chuyskywalker
Copy link
Contributor

Works on iPhone for me.

@Becold
Copy link
Contributor Author

Becold commented Aug 18, 2016

@rrbailey89 What is your setup, do you have nginx/apache reverse proxy ?
If so, you might have to create a new route to static/dist/data/searchmarkerstyle.min.json (which is auto-generated by grunt build)

@rrbailey89
Copy link
Contributor

rrbailey89 commented Aug 18, 2016

@Becold my apologies for taking so long to get back to you. I simply execute runserver.py im not behind any proxy. This first Screenshot is what I see when using my desktop.

j705jzj

this is what I see when using my Nexus 6.
screenshot_20160818-072605-2

I hope this helps.

@Zoruk
Copy link

Zoruk commented Aug 18, 2016

You just have to clear browser cache and refresh

@rrbailey89
Copy link
Contributor

@Zoruk @Becold Okay I guess it was the Cache :( .. never had to manually clear my devices browser cache before for this app... but after I did the dropdown menu populated properly.. this site is relevant for this

creatingwake pushed a commit to creatingwake/PokemonGo-Map that referenced this pull request Sep 5, 2016
creatingwake pushed a commit to creatingwake/PokemonGo-Map that referenced this pull request Sep 5, 2016
wobblybobz pushed a commit to wobblybobz/PokemonGo-Map that referenced this pull request Sep 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants