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

10 new map tile sources! #172

Closed
wants to merge 3 commits into
base: release/1.3
from

Conversation

Projects
None yet
3 participants
@0aveRyan
Contributor

0aveRyan commented Nov 18, 2014

In addition to Mapbox, there are now 10 more map backdrops!

  • New cmb box added in post.php screen lets user pick new tiles
  • Tiles get sucked into both front-end component and edit.php map coordinates selector!
  • Select defaults to 'mapbox' and has an a fallback incase custom-meta isn't set.

Some shortcomings

  • Doesn't swap tiles dynamically in back-end with select dropdown.
  • Adds new cmb box in post.php screen. Couldn't be avoided due to how tiles were being loaded into leaflet. Would have preferred the dropdown in the composer next to the other Map Component settings, but alas. You know some of these challenges...

0aveRyan added some commits Nov 18, 2014

Multiple Tile Vendors
Add tiles from Stamen, OSM and more sources. Creates new cmb in
edit.php screen with select that connects to conditional statements in
both component-map.php files (tiles show in backend editor and
front-end display!!) with attribution to sources.

- Maintains backwards compatibility by including Mapbox as a provider
and defaulting to it, as well as including an else statement to always
fallback to the original statement even if custom meta is undefined.
Sloppy, not too much bloat and effective.
- I know it’s less than ideal to add another custom meta box, I was
originally planning to add this as another shortcode element in the
composer, but due to the way Aesop loads the tiles saving as custom
meta was important.
FINAL-Multiple-tile-vendors
All clean and ready-to-go. Don’t forsee any issues with this one :)
@michaelbeil

This comment has been minimized.

Show comment
Hide comment
@michaelbeil

michaelbeil Nov 18, 2014

Collaborator

This could be nice to have provider options, but like Nick said, there's quite a bit that can be done to customize Mapbox maps. This may complicate things with all these additions. Definitely worth chatting about David. Thanks for bringing it up.

Collaborator

michaelbeil commented Nov 18, 2014

This could be nice to have provider options, but like Nick said, there's quite a bit that can be done to customize Mapbox maps. This may complicate things with all these additions. Definitely worth chatting about David. Thanks for bringing it up.

@bearded-avenger

This comment has been minimized.

Show comment
Hide comment
@bearded-avenger

bearded-avenger Nov 18, 2014

Collaborator

i think in the short term we may do a filter here in 1.3 so we can get David hooked up, then explore a wider integration on the next update.

Collaborator

bearded-avenger commented Nov 18, 2014

i think in the short term we may do a filter here in 1.3 so we can get David hooked up, then explore a wider integration on the next update.

@michaelbeil

This comment has been minimized.

Show comment
Hide comment
@michaelbeil

michaelbeil Nov 18, 2014

Collaborator

sounds like a plan.

Collaborator

michaelbeil commented Nov 18, 2014

sounds like a plan.

@0aveRyan

This comment has been minimized.

Show comment
Hide comment
@0aveRyan

0aveRyan Nov 18, 2014

Contributor

@bearded-avenger @michaelbeil a filter is a good start, definitely appreciated y'all!

I'm a longtime Mapbox and TileMill fan, top notch products and they're great about open source. However the registration and API rate limits also add complexity/complication. Perhaps consider one of those open source tileservers as a fallback or new default to keep things from breaking down if a user doesn't understand what map tiles are and their story goes viral.

Contributor

0aveRyan commented Nov 18, 2014

@bearded-avenger @michaelbeil a filter is a good start, definitely appreciated y'all!

I'm a longtime Mapbox and TileMill fan, top notch products and they're great about open source. However the registration and API rate limits also add complexity/complication. Perhaps consider one of those open source tileservers as a fallback or new default to keep things from breaking down if a user doesn't understand what map tiles are and their story goes viral.

@0aveRyan 0aveRyan closed this Nov 18, 2014

@bearded-avenger

This comment has been minimized.

Show comment
Hide comment
@bearded-avenger

bearded-avenger Nov 18, 2014

Collaborator

I'll admit some of these tiles are pretty sexy. It's such a tough call.

Collaborator

bearded-avenger commented Nov 18, 2014

I'll admit some of these tiles are pretty sexy. It's such a tough call.

@michaelbeil

This comment has been minimized.

Show comment
Hide comment
@michaelbeil

michaelbeil Nov 18, 2014

Collaborator

it's true.

Collaborator

michaelbeil commented Nov 18, 2014

it's true.

bearded-avenger pushed a commit that referenced this pull request Nov 18, 2014

@bearded-avenger

This comment has been minimized.

Show comment
Hide comment
@bearded-avenger

bearded-avenger Nov 18, 2014

Collaborator

OK how about this for now, with this filter you'll be able to change the map tile provider for each individual post. So in this example snippet below, if the post id is 2211, then change the map tile provider to stamen-toner.

add_filter('aesop_map_tile_provider','test_map_filter', 10, 2);
function test_map_filter($provider, $postid) {
    if(2211 == $postid) {
        $provider = 'stamen-toner';
    } else {
        $provider = 'mapbox';
    }
    return $provider;

}

We used some of your data on the pull-request to automatically provide support for the providers:

stamen-toner-lite
stamen-toner
stamen-watercolor
mapquest
acetate
hydda-full
Collaborator

bearded-avenger commented Nov 18, 2014

OK how about this for now, with this filter you'll be able to change the map tile provider for each individual post. So in this example snippet below, if the post id is 2211, then change the map tile provider to stamen-toner.

add_filter('aesop_map_tile_provider','test_map_filter', 10, 2);
function test_map_filter($provider, $postid) {
    if(2211 == $postid) {
        $provider = 'stamen-toner';
    } else {
        $provider = 'mapbox';
    }
    return $provider;

}

We used some of your data on the pull-request to automatically provide support for the providers:

stamen-toner-lite
stamen-toner
stamen-watercolor
mapquest
acetate
hydda-full
@bearded-avenger

This comment has been minimized.

Show comment
Hide comment
@bearded-avenger
Collaborator

bearded-avenger commented Nov 18, 2014

image 2014-11-18 at 12 08 36 pm

@bearded-avenger

This comment has been minimized.

Show comment
Hide comment
@bearded-avenger

bearded-avenger Nov 18, 2014

Collaborator

oh, also, if you leave out the whole if statement that checks for the postid, then it will use those tiles on all maps on the site.

Collaborator

bearded-avenger commented Nov 18, 2014

oh, also, if you leave out the whole if statement that checks for the postid, then it will use those tiles on all maps on the site.

@0aveRyan

This comment has been minimized.

Show comment
Hide comment
@0aveRyan

0aveRyan Nov 18, 2014

Contributor

Wow love the Toner behind the page container! Thanks for improving the implementation!

Contributor

0aveRyan commented Nov 18, 2014

Wow love the Toner behind the page container! Thanks for improving the implementation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment