Skip to content

Instantly share code, notes, and snippets.

@Qaezel
Last active August 29, 2015 14:09
Show Gist options
  • Save Qaezel/861dcb7b42255fd93ddc to your computer and use it in GitHub Desktop.
Save Qaezel/861dcb7b42255fd93ddc to your computer and use it in GitHub Desktop.
designer
<link rel="import" href="../core-scaffold/core-scaffold.html">
<link rel="import" href="../core-header-panel/core-header-panel.html">
<link rel="import" href="../core-menu/core-menu.html">
<link rel="import" href="../core-item/core-item.html">
<link rel="import" href="../core-icon-button/core-icon-button.html">
<link rel="import" href="../core-toolbar/core-toolbar.html">
<link rel="import" href="../core-field/core-field.html">
<link rel="import" href="../core-icon/core-icon.html">
<link rel="import" href="../core-input/core-input.html">
<link rel="import" href="../core-icons/core-icons.html">
<link rel="import" href="../speech-mic/speech-mic.html">
<link rel="import" href="../core-menu/core-submenu.html">
<link rel="import" href="../google-map/google-map.html">
<link rel="import" href="../google-map/google-map-search.html">
<polymer-element name="my-map-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
box-sizing: border-box;
}
#core_scaffold {
position: absolute;
top: 0px;
right: 0px;
bottom: 0px;
left: 0px;
width: 100%;
height: 100%;
}
#core_header_panel {
background-color: rgb(255, 255, 255);
}
#core_toolbar {
color: rgb(255, 255, 255);
background-color: rgb(79, 125, 201);
}
#core_menu {
font-size: 16px;
}
#input {
padding: 15px;
}
#core_field {
background-color: rgb(255, 255, 255);
}
#speech_mic {
left: -10px;
}
#google_map {
width: 100%;
height: 100%;
display: block;
left: 0px;
top: 0px;
position: absolute;
}
#google_map_search {
left: 290px;
top: 350px;
position: absolute;
}
#core_icon {
width: 40px;
height: 30px;
}
</style>
<core-scaffold id="core_scaffold">
<core-header-panel mode="seamed" id="core_header_panel" navigation flex>
<core-toolbar id="core_toolbar">
<core-field id="core_field" icon="search" theme="core-light-theme" center horizontal layout one flex>
<core-icon icon="search" id="core_icon"></core-icon>
<input committedvalue="{{ $.speech_mic.transcript }}" id="input" value="{{ $.speech_mic.transcript }}" placeholder="type something..." is="core-input">
<speech-mic completetranscript="preview" id="speech_mic"></speech-mic>
</core-field>
</core-toolbar>
<core-menu selected="Home" valueattr="label" selectedindex="0" id="core_menu" theme="core-light-theme">
<core-item id="core_item" icon="home" label="Home" on-tap="{{ home }}" horizontal center layout active></core-item>
<core-item id="core_item1" icon="maps:directions-subway" label="Tennoji" on-tap="{{ tennoji }}" horizontal center layout></core-item>
<core-item id="core_item1" icon="maps:directions-subway" label="Namba" on-tap="{{ namba }}" horizontal center layout></core-item>
<core-item id="core_item1" icon="maps:directions-subway" label="Shinsaibashi" on-tap="{{ shinsaibashi }}" horizontal center layout></core-item>
<core-item id="core_item1" icon="maps:directions-subway" label="Umeda" on-tap="{{ umeda }}" horizontal center layout></core-item>
</core-menu>
</core-header-panel>
<div id="div" tool>Jeremy's Map</div>
<google-map latitude="{{ $.google_map_search.result.latitude }}" longitude="{{ $.google_map_search.result.longitude }}" zoom="14" id="google_map">
<google-map-marker longitude="-122.4376" latitude="37.769421" id="google_map_marker"></google-map-marker>
</google-map>
<google-map-search map="{{ $.google_map.map }}" query="{{ $.input.value }}" id="google_map_search"></google-map-search>
</core-scaffold>
</template>
<script>
Polymer({
domReady: function () {
this.$.google_map_search.query = "Osaka";
this.$.google_map.zoom = 9;
},
home: function () {
this.$.google_map.latitude= 34.5708871;
this.$.google_map.longitude= 135.5108445;
this.$.google_map.zoom = 17;
this.$.google_map_marker.latitude = 34.571578;
this.$.google_map_marker.longitude = 135.510224;
},
tennoji: function () {
this.$.google_map.latitude = 34.647322;
this.$.google_map.longitude = 135.513592;
this.$.google_map.zoom = 17;
this.$.google_map_marker.latitude = 34.647322;
this.$.google_map_marker.longitude = 135.513592;
},
namba: function () {
this.$.google_map.latitude = 34.667143;
this.$.google_map.longitude = 135.500342;
this.$.google_map.zoom = 17;
this.$.google_map_marker.latitude = 34.667143;
this.$.google_map_marker.longitude = 135.500342;
},
shinsaibashi: function () {
this.$.google_map.latitude = 34.675151;
this.$.google_map.longitude = 135.500321;
this.$.google_map.zoom = 17;
this.$.google_map_marker.latitude = 34.675151;
this.$.google_map_marker.longitude = 135.500321;
},
umeda: function () {
this.$.google_map.latitude = 34.702900;
this.$.google_map.longitude = 135.497864;
this.$.google_map.zoom = 17;
this.$.google_map_marker.latitude = 34.702900;
this.$.google_map_marker.longitude = 135.497864;
}
});
</script>
</polymer-element>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment