{"id":688,"date":"2016-12-27T09:40:19","date_gmt":"2016-12-27T00:40:19","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=688"},"modified":"2017-02-10T13:54:28","modified_gmt":"2017-02-10T04:54:28","slug":"swift-googlemap-polyline%e3%82%92%e3%82%bf%e3%83%83%e3%83%97%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swift-googlemap-polyline%e3%82%92%e3%82%bf%e3%83%83%e3%83%97%e3%81%a7%e3%81%8d%e3%82%8b%e3%82%88%e3%81%86%e3%81%ab%e3%81%99%e3%82%8b\/","title":{"rendered":"[swift] GoogleMap Polyline\u3092\u30bf\u30c3\u30d7\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b"},"content":{"rendered":"<h2>GoogleMap Polyline\u3092\u30bf\u30c3\u30d7\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b<\/h2>\n<p>GoogleMap\u306b\u914d\u7f6e\u3057\u305fPolyline\u306a\u3069\u306e\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3082\u30de\u30fc\u30ab\u30fc\u540c\u69d8\u30bf\u30c3\u30d7\u3067\u53cd\u5fdc\u3067\u304d\u308b\u3088\u3046\u306b\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b<\/p>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9<br \/>\nGoogleMap\u306e\u30d9\u30fc\u30b9\u306f\u5b8c\u6210\u3057\u3066\u3044\u308b\u3082\u306e\u3068\u3059\u308b<\/p>\n<pre>\r\nfunc polylineInit(){\r\n    var latitude: CLLocationDegrees = 1.304843 \/\/Singapore\r\n    var longitude: CLLocationDegrees = 103.831824 \/\/Singapore\r\n    \r\n    var oldlatitude: CLLocationDegrees = 1.304850 \/\/Singapore\r\n    var oldlongitude: CLLocationDegrees = 103.831830 \/\/Singapore\r\n\r\n    let path = GMSMutablePath() \/\/\u7dda\u306e\u6e96\u5099\r\n    path.addCoordinate(CLLocationCoordinate2DMake(oldlatitude, oldlongitude)) \/\/\u7dda\u306e\u90e8\u54c1\u751f\u6210\r\n    path.addCoordinate(CLLocationCoordinate2DMake(latitude, longitude)) \/\/\u7dda\u306e\u90e8\u54c1\u751f\u6210\r\n                \r\n    let polyline = GMSPolyline(path: path) \/\/\u7dda\u3092\u4f5c\u6210\r\n    polyline.spans = [GMSStyleSpan(style: GMSStrokeStyle.solidColor(kMapLineBaseColor))]\r\n    polyline.strokeWidth = 5.0\/\/\u7dda\u306e\u592a\u3055\r\n    polyline.map = mapView\/\/\u7dda\u3092\u63cf\u753b\r\n    polyline.tappable = true\r\n    polyline.title = \"1\"\r\n}\r\n\r\nfunc mapView(mapView: GMSMapView, didTapOverlay overlay: GMSOverlay) {\r\n    let str = overlay.title \/\/Polyline\u306eTitle\u3092\u53d6\u5f97\r\n    \/\/\u30bf\u30c3\u30d7\u3057\u305f\u3068\u304d\u306e\u51e6\u7406\r\n}\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>GoogleMap Polyline\u3092\u30bf<\/p>\n","protected":false},"author":1,"featured_media":920,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13],"tags":[19],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/688"}],"collection":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/comments?post=688"}],"version-history":[{"count":1,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/688\/revisions"}],"predecessor-version":[{"id":689,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/688\/revisions\/689"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media\/920"}],"wp:attachment":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media?parent=688"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=688"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=688"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}