﻿
{"id":1109,"date":"2012-12-10T13:56:15","date_gmt":"2012-12-10T13:56:15","guid":{"rendered":"http:\/\/www.gencayyildiz.com\/blog\/?p=1109"},"modified":"2012-12-10T13:56:52","modified_gmt":"2012-12-10T13:56:52","slug":"google-map-api-3-0-ipye-gore-bulundugunuz-yeri-gosteren-v3-kodu","status":"publish","type":"post","link":"https:\/\/www.gencayyildiz.com\/blog\/google-map-api-3-0-ipye-gore-bulundugunuz-yeri-gosteren-v3-kodu\/","title":{"rendered":"Google Map Api 3.0 &#8211; IPye G\u00f6re Bulundu\u011funuz Yeri G\u00f6steren V3 Kodu"},"content":{"rendered":"<div id=\"fb-root\"><\/div>\n<pre class=\"brush: jscript; title: ; notranslate\" title=\"\">\r\n&lt;html&gt;\r\n&lt;head&gt;\r\n&lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot; \/&gt;\r\n&lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=UTF-8&quot;\/&gt;\r\n&lt;title&gt;Google Maps JavaScript API v3 Example: Map Geolocation&lt;\/title&gt;\r\n&lt;link href=&quot;http:\/\/code.google.com\/apis\/maps\/documentation\/javascript\/examples\/default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; \/&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/maps.googleapis.com\/maps\/api\/js?sensor=true&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.google.com\/apis\/gears\/gears_init.js&quot;&gt;&lt;\/script&gt;\r\n&lt;script type=&quot;text\/javascript&quot;&gt;\r\nvar initialLocation;\r\nvar siberia = new google.maps.LatLng(60, 105);\r\nvar newyork = new google.maps.LatLng(40.69847032728747, -73.9514422416687);\r\nvar browserSupportFlag =  new Boolean();\r\nvar map;\r\nvar infowindow = new google.maps.InfoWindow();\r\nfunction initialize() {\r\n  var myOptions = {\r\n    zoom: 6,\r\n    mapTypeId: google.maps.MapTypeId.ROADMAP\r\n  };\r\n  map = new google.maps.Map(document.getElementById(&quot;map_canvas&quot;), myOptions);\r\n\r\n  \/\/ Try W3C Geolocation method (Preferred)\r\n  if(navigator.geolocation) {\r\n    browserSupportFlag = true;\r\n    navigator.geolocation.getCurrentPosition(function(position) {\r\n      initialLocation = new google.maps.LatLng(position.coords.latitude,position.coords.longitude);\r\n      contentString = &quot;Location found using W3C standard&quot;;\r\n      map.setCenter(initialLocation);\r\n      infowindow.setContent(contentString);\r\n      infowindow.setPosition(initialLocation);\r\n      infowindow.open(map);\r\n    }, function() {\r\n      handleNoGeolocation(browserSupportFlag);\r\n    });\r\n  } else if (google.gears) {\r\n    \/\/ Try Google Gears Geolocation\r\n    browserSupportFlag = true;\r\n    var geo = google.gears.factory.create('beta.geolocation');\r\n    geo.getCurrentPosition(function(position) {\r\n      initialLocation = new google.maps.LatLng(position.latitude,position.longitude);\r\n      contentString = &quot;Location found using Google Gears&quot;;\r\n      map.setCenter(initialLocation);\r\n      infowindow.setContent(contentString);\r\n      infowindow.setPosition(initialLocation);\r\n      infowindow.open(map);\r\n    }, function() {\r\n      handleNoGeolocation(browserSupportFlag);\r\n    });\r\n  } else {\r\n    \/\/ Browser doesn't support Geolocation\r\n    browserSupportFlag = false;\r\n    handleNoGeolocation(browserSupportFlag);\r\n  }\r\n}\r\nfunction handleNoGeolocation(errorFlag) {\r\n  if (errorFlag == true) {\r\n    initialLocation = newyork;\r\n    contentString = &quot;Error: The Geolocation service failed.&quot;;\r\n  } else {\r\n    initialLocation = siberia;\r\n    contentString = &quot;Error: Your browser doesn't support geolocation. Are you in Siberia?&quot;;\r\n  }\r\n  map.setCenter(initialLocation);\r\n  infowindow.setContent(contentString);\r\n  infowindow.setPosition(initialLocation);\r\n  infowindow.open(map);\r\n}\r\n&lt;\/script&gt;\r\n&lt;\/head&gt;\r\n&lt;body onload=&quot;initialize()&quot;&gt;\r\n  &lt;div id=&quot;map_canvas&quot;&gt;&lt;\/div&gt;\r\n&lt;\/body&gt;\r\n&lt;\/html&gt;\r\n<\/pre>\n<!-- AddThis Advanced Settings generic via filter on the_content --><!-- AddThis Share Buttons generic via filter on the_content -->","protected":false},"excerpt":{"rendered":"<p>&lt;html&gt; &lt;head&gt; &lt;meta name=&quot;viewport&quot; content=&quot;initial-scale=1.0, user-scalable=no&quot; \/&gt; &lt;meta http-equiv=&quot;content-type&quot; content=&quot;text\/html; charset=UTF-8&quot;\/&gt; &lt;title&gt;Google Maps JavaScript API v3 Example: Map Geolocation&lt;\/title&gt; &lt;link href=&quot;http:\/\/code.google.com\/apis\/maps\/documentation\/javascript\/examples\/default.css&quot; rel=&quot;stylesheet&quot; type=&quot;text\/css&quot; \/&gt; &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/maps.googleapis.com\/maps\/api\/js?sensor=true&quot;&gt;&lt;\/script&gt; &lt;script type=&quot;text\/javascript&quot; src=&quot;http:\/\/code.google.com\/apis\/gears\/gears_init.js&quot;&gt;&lt;\/script&gt; &lt;script type=&quot;text\/javascript&quot;&gt; var initialLocation;&#46;&#46;&#46;<!-- AddThis Advanced Settings generic via filter on get_the_excerpt --><!-- AddThis Share Buttons generic via filter on get_the_excerpt --><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[300],"tags":[301,303,253,304,302],"class_list":["post-1109","post","type-post","status-publish","format-standard","hentry","category-google-teknolojileri","tag-api","tag-api-3-0","tag-google","tag-ip","tag-v3"],"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/1109","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/comments?post=1109"}],"version-history":[{"count":0,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/posts\/1109\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/media?parent=1109"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/categories?post=1109"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.gencayyildiz.com\/blog\/wp-json\/wp\/v2\/tags?post=1109"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}