diff --git a/demo/index.html b/demo/index.html
index a2a4bc7..9000012 100644
--- a/demo/index.html
+++ b/demo/index.html
@@ -26,7 +26,7 @@
+ title="Go Giants!" draggable="true" drag-events>
@@ -50,6 +50,18 @@
function toggleControls() {
gmap.disableDefaultUi = !gmap.disableDefaultUi;
}
+
+ var marker = document.querySelector('google-map-marker');
+ var poly = document.querySelector('google-map-poly');
+ var point = document.querySelector('google-map-point');
+
+ marker.addEventListener('google-map-marker-dragend', function(e) {
+ var latLng = e.detail.latLng;
+ console.log('pin dropped', latLng.lat(), latLng.lng());
+ point.latitude = latLng.lat();
+ point.longitude = latLng.lng();
+ poly._buildPathFromPoints();
+ });