Skip to content

[WIP] Add static mode#435

Merged
mcwhittemore merged 12 commits intomapbox:masterfrom
drewbo:static
Jun 30, 2016
Merged

[WIP] Add static mode#435
mcwhittemore merged 12 commits intomapbox:masterfrom
drewbo:static

Conversation

@drewbo
Copy link
Contributor

@drewbo drewbo commented Jun 29, 2016

Ref #109 cc: @mcwhittemore

Happy to make any adjustments to make this more resilient, can add a few tests too

@mcwhittemore
Copy link
Contributor

@drewbo thanks for this. I know turning of interactivity is something a bunch of people are interested in so its good to see movement here.

Here are the things I think are left to do.

  • update the Draw.changeMode() doc to describe this mode. (note there is no way to get to it or out of it except via Draw.changeMode())
  • update the styling docs to mention this mode
  • update the default style to handle this mode
  • write a few tests that confirm this mode doesn't do the same thing as simple_select.
  • fix linting errors

module.exports = function(ctx) {
return {
stop: function() {
ctx.map.doubleClickZoom.enable();
Copy link
Contributor

Choose a reason for hiding this comment

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

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, though, I'm confused as to why this needs to enable the zoom. Don't the other modes that disable zoom clean themselves up?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yup, I think this is mostly me being sloppy when I was first adding it for myself. I'll remove.

@drewbo
Copy link
Contributor Author

drewbo commented Jun 29, 2016

@mcwhittemore made the changes above with two remaining items to hit that I could use some assistance on:

  • options.test.js is now failing because fixtures/style_with_sources.json needs to be updated to reflect the new base style. What's the easiest way to update the fixture?
  • I had to add map.dragPan.disable.restore(); before wrapping that method in static.test.js because it is already wrapped from simple_select.test.js. The new test runs fine on its own without that line. Should the spy be "unwrapped" in simple_select.test.js instead?

@drewbo drewbo closed this Jun 29, 2016
@drewbo drewbo reopened this Jun 29, 2016
@mcwhittemore
Copy link
Contributor

What's the easiest way to update the fixture?

Oh man. Not sure. Maybe you can console log it out.

Should the spy be "unwrapped" in simple_select.test.js instead?

Yea, that sounds good to me.

@drewbo
Copy link
Contributor Author

drewbo commented Jun 29, 2016

@mcwhittemore updated the fixture. I left the other issue as is because I couldn't reliably .restore the method in simple_select.test.js and still have everything work. Not totally positive what the issue is but the tests do pass now

@mcwhittemore
Copy link
Contributor

@drewbo this is looking good. The only problem I see is that the cursor still changes to 👆 hand when I hover over the feature in static mode. Lets fix this up (add mode classes to the cursors css) and then rebase and we should be good.

Thanks!

@drewbo
Copy link
Contributor Author

drewbo commented Jun 30, 2016

@mcwhittemore will do. Do we still need to rebase if we can squash the commits with GH?

@mcwhittemore
Copy link
Contributor

@drewbo um, as long as the out-of-date warning goes away I'm happy.

@drewbo
Copy link
Contributor Author

drewbo commented Jun 30, 2016

Not positive what the out-of-date warning is but I added the styling

@mcwhittemore
Copy link
Contributor

@drewbo I'm talking about the warning git hub is displaying above the comment box.

image

@drewbo
Copy link
Contributor Author

drewbo commented Jun 30, 2016

Ah, got it. I don't see those but I merged master on.

@mcwhittemore mcwhittemore merged commit 5055ece into mapbox:master Jun 30, 2016
@mcwhittemore
Copy link
Contributor

@drewbo merged and published (0.11.2). We're keeping the 0.10.x line as the main line in npm now so make sure you install 0.11.2 specifically.

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.

3 participants