Skip to content

Instantly share code, notes, and snippets.

@prudvi
Last active September 25, 2016 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save prudvi/3110fa17c13e4e2f951e6f82fb5d8e93 to your computer and use it in GitHub Desktop.
Save prudvi/3110fa17c13e4e2f951e6f82fb5d8e93 to your computer and use it in GitHub Desktop.
map places autocomplete
import Ember from 'ember';
export default Ember.Component.extend({
place: 'Bangalore',
});
import Ember from 'ember';
export default Ember.Controller.extend({
appName: 'Ember Twiddle'
});
html, body {
height: 100%;
margin: 0;
padding: 0;
}
#map {
height: 100%;
}
.controls {
margin-top: 10px;
border: 1px solid transparent;
border-radius: 2px 0 0 2px;
box-sizing: border-box;
-moz-box-sizing: border-box;
height: 32px;
outline: none;
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
}
#pac-input {
background-color: #fff;
font-family: Roboto;
font-size: 15px;
font-weight: 300;
margin-left: 12px;
padding: 0 11px 0 13px;
text-overflow: ellipsis;
width: 300px;
}
#pac-input:focus {
border-color: #4d90fe;
}
.pac-container {
font-family: Roboto;
}
#type-selector {
color: #fff;
background-color: #4d90fe;
padding: 5px 11px 0px 11px;
}
#type-selector label {
font-family: Roboto;
font-size: 13px;
font-weight: 300;
}
<h1>Welcome to {{appName}}</h1>
<br>
<br>
{{outlet}}
{{map-component}}
<br>
<br>
{{input type="text" value=place id="pac-input" class="controls"
placeholder="Enter a location"}}
<input id="pac-input" class="controls" type="text"
placeholder="Enter a location">
<div id="type-selector" class="controls">
<input type="radio" name="type" id="changetype-all" checked="checked">
<label for="changetype-all">All</label>
<input type="radio" name="type" id="changetype-establishment">
<label for="changetype-establishment">Establishments</label>
<input type="radio" name="type" id="changetype-address">
<label for="changetype-address">Addresses</label>
<input type="radio" name="type" id="changetype-geocode">
<label for="changetype-geocode">Geocodes</label>
</div>
<div id="map"></div>
{
"version": "0.10.5",
"EmberENV": {
"FEATURES": {}
},
"options": {
"use_pods": false,
"enable-testing": false
},
"dependencies": {
"jquery": "https://cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.js",
"ember": "2.8.0",
"ember-data": "2.8.0",
"ember-template-compiler": "2.8.0",
"ember-testing": "2.8.0",
"map": "https://maps.googleapis.com/maps/api/js?key=AIzaSyBU5ylhdLUJ4oC1kWwaNvl9PZhHucqOOas&libraries=places&callback=initMap"
},
"addons": {}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment