Skip to content

Instantly share code, notes, and snippets.

🥑
coding lotsa code

Matt Gardner allthesignals

🥑
coding lotsa code
Block or report user

Report or block allthesignals

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View mocking-mapbox-gl-tiles.md

Goal

I'd like to mock the requests for tiles made by MapboxGL using Pretender.

Problem

Pretender doesn't intercept those requests

What I've discovered

@allthesignals
allthesignals / controllers.application.js
Last active Dec 23, 2019
Mapping with Ember MapboxGL
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View feature.geojson
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View carto-data-provider.js
export default class CartoDataProvider extends Component {
@service
router;
@service
store;
modelName = 'carto-geojson-feature';
modelId = null;
View controllers.application.js
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
View components.my-component.js
import Ember from 'ember';
export default Ember.Component.extend({
});
View projects-map.hbs
{{#mapbox-gl as |map|}}
{{map.on 'click' (action 'handleMapClick')}}
{{map.on 'mousemove' (action 'handleMouseMove')}}
{{!-- Two yields implicitly merge the mapbox-gl addon's block params API with our own
internal extensions --}}
{{yield map}}
{{yield (hash
dynamic-tiles=(component 'mapbox-gl-dynamic-tiles'
map=map
View my-mergy-component.hbs
{{yield (hash someApi=(action 'api'))}}
{{yield (hash anotherApi=(action 'anotherApi')}}
View yarn.lock
# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.
# yarn lockfile v1
"@babel/code-frame@7.0.0-beta.44":
version "7.0.0-beta.44"
resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz#2a02643368de80916162be70865c97774f3adbd9"
dependencies:
"@babel/highlight" "7.0.0-beta.44"
You can’t perform that action at this time.