Last active
March 10, 2021 15:10
-
-
Save jkarsrud/fe567ad6eb14066c8068d5f03d027bec to your computer and use it in GitHub Desktop.
Leaflet multiple markers on map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Ember from 'ember'; | |
export default Ember.Controller.extend({ | |
appName: 'Ember Twiddle', | |
lat: 59.9200, | |
long: 10.7450, | |
zoom: 13, | |
markers: [ | |
{ name: 'Grünerløkka', coords: [59.9239, 10.7578] }, | |
{ name: 'Majorstua', coords: [59.9268, 10.7162] } | |
], | |
actions: { | |
addMarker() { | |
const marker = { name: 'Bislett', coords: [59.9250, 10.7334]}; | |
this.set('markers', [...this.markers, marker]) | |
} | |
} | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
body { | |
margin: 12px 16px; | |
font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; | |
font-size: 12pt; | |
} | |
.leaflet-container { | |
width: 500px; | |
height: 400px; | |
} | |
.marker-icon { | |
width: 20px; | |
height: 20px; | |
background: blue; | |
transform: rotate(45deg); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.15.1", | |
"EmberENV": { | |
"FEATURES": {} | |
}, | |
"options": { | |
"use_pods": false, | |
"enable-testing": false | |
}, | |
"dependencies": { | |
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.js", | |
"ember": "3.4.3", | |
"ember-template-compiler": "3.4.3", | |
"ember-testing": "3.4.3" | |
}, | |
"addons": { | |
"ember-data": "3.4.2", | |
"ember-leaflet": "3.0.18" | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment