Skip to content

Instantly share code, notes, and snippets.

@mattcooper-hdr
Created January 20, 2021 16:54
Show Gist options
  • Save mattcooper-hdr/6a1c89edf6af50b3d1ceb13ecaf800a9 to your computer and use it in GitHub Desktop.
Save mattcooper-hdr/6a1c89edf6af50b3d1ceb13ecaf800a9 to your computer and use it in GitHub Desktop.
ember-leaflet In Tab
import Controller from '@ember/controller';
import { tracked } from "@glimmer/tracking";
export default class ApplicationController extends Controller {
appName = 'Ember Twiddle';
@tracked lat = 38.77;
@tracked long = -100.79;
@tracked zoom = 3;
}
body {
margin: 12px 16px;
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif;
font-size: 12pt;
}
.leaflet-container {
height: 300px;
}
<h1>Welcome to {{this.appName}}</h1>
<br>
<br>
{{outlet}}
<BsTab as |tab|>
<tab.pane @title="Tab 1">
<LeafletMap class="esri-map" @lat={{this.lat}} @lng={{this.long}} @zoom={{this.zoom}} as |layers|>
<layers.tile @url="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"/>
</LeafletMap>
</tab.pane>
<tab.pane @title="Tab 2">
<p>At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Temporibus autem quibusdam et aut officiis debitis aut rerum necessitatibus saepe eveniet ut et voluptates repudiandae sint et molestiae non recusandae. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.</p>
</tab.pane>
</BsTab>
<br>
<LeafletMap class="esri-map" @lat={{this.lat}} @lng={{this.long}} @zoom={{this.zoom}} as |layers|>
<layers.tile @url="https://{s}.basemaps.cartocdn.com/light_all/{z}/{x}/{y}.png"/>
</LeafletMap>
<br>
<br>
{
"version": "0.17.1",
"EmberENV": {
"FEATURES": {},
"_TEMPLATE_ONLY_GLIMMER_COMPONENTS": false,
"_APPLICATION_TEMPLATE_WRAPPER": true,
"_JQUERY_INTEGRATION": true
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.1/jquery.js",
"ember": "3.18.1",
"ember-template-compiler": "3.18.1",
"ember-testing": "3.18.1",
"leaflet": "1.7.1",
"bootstrap": "4.5.3"
},
"addons": {
"@glimmer/component": "1.0.0",
"ember-bootstrap": "3.1.4",
"ember-leaflet": "4.1.1"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment