{"id":229,"date":"2014-05-28T13:05:25","date_gmt":"2014-05-28T13:05:25","guid":{"rendered":"http:\/\/www.honobono-life.info\/wpeng\/?p=229"},"modified":"2017-10-08T00:21:30","modified_gmt":"2017-10-08T00:21:30","slug":"simple-polylines","status":"publish","type":"post","link":"http:\/\/www.honobono-life.info\/wpeng\/simple-polylines\/","title":{"rendered":"Google Maps for AngularJS Simple Polylines"},"content":{"rendered":"<ul>\r\n<li>AngularJS : 1.2.23<\/li>\r\n<li>Bootstrap : 3.2.0<\/li>\r\n<li>Google Maps for AngularJS : 1.0.16<\/li>\r\n<li>include file<\/li>\r\nangular.min.js, underscore-min.js, angular-google-maps.min.js, ui-bootstrap-tpls-0.9.0.min.js\r\n<\/ul>\r\n<!--more-->\r\n<script type='text\/javascript' src='http:\/\/www.honobono-life.info\/wpeng\/wp-content\/themes\/ang\/js\/angular.min.js'><\/script><script type='text\/javascript' src='http:\/\/www.honobono-life.info\/wpeng\/wp-content\/themes\/ang\/js\/ui-bootstrap-tpls-0.11.0.min.js'><\/script><script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?v=3.exp&#038;key=AIzaSyBy-VhEHgZFREbgrTWoXTTW04hEW-PyHdA&#038;sensor=false\"><\/script>\r\n<script type='text\/javascript' src='http:\/\/www.honobono-life.info\/wpeng\/wp-content\/themes\/ang\/js\/underscore-min.js'><\/script>\r\n<script type='text\/javascript' src='http:\/\/www.honobono-life.info\/wpeng\/wp-content\/themes\/ang\/js\/angular-google-maps.min.js'><\/script>\r\n<script type='text\/javascript' src='http:\/\/www.honobono-life.info\/wpeng\/wp-content\/themes\/ang\/js\/poly.js'><\/script>\r\n<div ng-app=\"googleMapApp\" role=\"tabpanel\">\r\n  <ul class=\"nav nav-tabs\">\r\n    <li class=\"active\"><a href=\"#demo1\" data-toggle=\"tab\">demo<\/a><\/li>\r\n    <li><a href=\"#html1\" data-toggle=\"tab\">markup<\/a><\/li>\r\n    <li><a href=\"#script1\" data-toggle=\"tab\">script<\/a><\/li>\r\n  <\/ul>\r\n  <div class=\"tab-content\">\r\n    <div class=\"tab-pane active\" id=\"demo1\">\r\n\r\n<div ng-controller=\"MyCtrl\">\r\n<div class=\"row\">\r\n  <div class=\"col-sm-12\">\r\n    <google-map \r\n      id=\"map-canvas\"\r\n      center=\"map.center\"\r\n      zoom=\"map.zoom\"\r\n      draggable=\"true\"\r\n      dragging=\"map.dragging\"\r\n      options=\"map.options\"\r\n    >\r\n      <polyline ng-repeat=\"p in map.polylines\" \r\n                path=\"p.path\"\r\n                stroke=\"p.stroke\" \r\n                visible='p.visible'\r\n                geodesic='p.geodesic' \r\n                fit=\"false\"\r\n                editable=\"p.editable\" \r\n                draggable=\"p.draggable\">\r\n      <\/polyline>\r\n    <\/google-map>\r\n  <\/div>\r\n<\/div>\r\n<\/div>\r\n\r\n    <\/div>\r\n    <div class=\"tab-pane\" id=\"html1\">\r\n<pre>\r\n&lt;script src=\"https:\/\/maps.googleapis.com\/maps\/api\/js?v=3.exp&key=xxxxxxxxxxxxxxxxxx&sensor=false&libraries=places\"&gt;&lt;\/script&gt;\r\n&lt;script type='text\/javascript' src='http:\/\/www.example.com\/wp\/wp-content\/themes\/ang\/js\/underscore-min.js'>&lt;\/script>\r\n&lt;script type='text\/javascript' src='http:\/\/www.example.com\/wp\/wp-content\/themes\/ang\/js\/angular-google-maps.min.js'>&lt;\/script>\r\n&lt;script type='text\/javascript' src='http:\/\/www.example.com\/wp\/wp-content\/themes\/ang\/js\/app.js'&gt;&lt;\/script&gt;\r\n\r\n&lt;div ng-controller=\"MyCtrl\"&gt;\r\n&lt;div class=\"row\"&gt;\r\n  &lt;div class=\"col-sm-12\"&gt;\r\n    &lt;google-map \r\n      id=\"map-canvas\"\r\n      center=\"map.center\"\r\n      zoom=\"map.zoom\"\r\n      draggable=\"true\"\r\n      dragging=\"map.dragging\"\r\n      options=\"map.options\"\r\n    &gt;\r\n      &lt;polyline ng-repeat=\"p in map.polylines\" \r\n                path=\"p.path\"\r\n                stroke=\"p.stroke\" \r\n                visible='p.visible'\r\n                geodesic='p.geodesic' \r\n                fit=\"false\"\r\n                editable=\"p.editable\" \r\n                draggable=\"p.draggable\"&gt;\r\n      &lt;\/polyline&gt;\r\n    &lt;\/google-map&gt;\r\n  &lt;\/div&gt;\r\n&lt;\/div&gt;\r\n&lt;\/div&gt;\r\n<\/pre>\r\n    <\/div>\r\n\r\n    <div class=\"tab-pane\" id=\"script1\">\r\n<pre>\r\nvar mapApp = angular.module('googleMapApp', ['google-maps','ui.bootstrap']);\r\n\r\nmapApp.controller(\"MyCtrl\", function ($scope) {\r\n  angular.extend($scope, {\r\n  map: {\r\n      center: {\r\n        latitude: 35.681382,\r\n        longitude: 139.766084\r\n      },\r\n      options: {\r\n        maxZoom: 20,\r\n        minZoom: 3\r\n      },\r\n      zoom: 15,\r\n      polylines: [\r\n          {\r\n              path: [\r\n                  {\r\n                      latitude: 35.67941788049046,\r\n                      longitude: 139.75768089294434\r\n                  },\r\n                  {\r\n                      latitude: 35.67793632362604,\r\n                      longitude: 139.76341009140015\r\n                  },\r\n                  {\r\n                      latitude: 35.680759972963095,\r\n                      longitude: 139.76446151733398\r\n                  },\r\n                  {\r\n                      latitude: 35.68130028953324,\r\n                      longitude: 139.76555585861206\r\n                  }\r\n              ],\r\n              stroke: {\r\n                  color: '#6060FB',\r\n                  weight: 4\r\n              },\r\n              editable: true,\r\n              draggable: false,\r\n              geodesic: false,\r\n              visible: true\r\n          },\r\n          {\r\n              path: [\r\n                  {\r\n                      latitude: 35.682572633455436,\r\n                      longitude: 139.77615594863892\r\n                  },\r\n                  {\r\n                      latitude: 35.681579161170134,\r\n                      longitude: 139.77576971054077\r\n                  },\r\n                  {\r\n                      latitude: 35.682502916505676,\r\n                      longitude: 139.77373123168945\r\n                  },\r\n                  {\r\n                      latitude: 35.67920872118891,\r\n                      longitude: 139.77173566818237\r\n                  }\r\n              ],\r\n              stroke: {\r\n                  color: '#6060FB',\r\n                  weight: 3\r\n              },\r\n              editable: true,\r\n              draggable: true,\r\n              geodesic: true,\r\n              visible: true\r\n          }\r\n      ]\r\n  }\r\n  });\r\n});\r\n<\/pre>\r\n    <\/div><!-- \/.tab-pane -->\r\n\r\n  <\/div><!-- \/.tab-content -->\r\n<\/div><!-- \/.tabpanel -->\r\n","protected":false},"excerpt":{"rendered":"<p>AngularJS : 1.2.23 Bootstrap : 3.2.0 Google Maps for AngularJS : 1.0.16 include file angular.min.js, underscore-min.js, angular-google-maps.min.js, ui-bootstrap-tpls-0.9.0.min.js<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[35,49,50],"amp_enabled":true,"_links":{"self":[{"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/posts\/229"}],"collection":[{"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/comments?post=229"}],"version-history":[{"count":8,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/posts\/229\/revisions"}],"predecessor-version":[{"id":1440,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/posts\/229\/revisions\/1440"}],"wp:attachment":[{"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/media?parent=229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/categories?post=229"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.honobono-life.info\/wpeng\/wp-json\/wp\/v2\/tags?post=229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}