{"action":"opened","issue":{"url":"https://api.github.com/repos/emberjs/guides/issues/1553","repository_url":"https://api.github.com/repos/emberjs/guides","labels_url":"https://api.github.com/repos/emberjs/guides/issues/1553/labels{/name}","comments_url":"https://api.github.com/repos/emberjs/guides/issues/1553/comments","events_url":"https://api.github.com/repos/emberjs/guides/issues/1553/events","html_url":"https://github.com/emberjs/guides/issues/1553","id":163599446,"number":1553,"title":"variable shadowing in guides for google map service","user":{"login":"bambery","id":161639,"avatar_url":"https://avatars.githubusercontent.com/u/161639?v=3","gravatar_id":"","url":"https://api.github.com/users/bambery","html_url":"https://github.com/bambery","followers_url":"https://api.github.com/users/bambery/followers","following_url":"https://api.github.com/users/bambery/following{/other_user}","gists_url":"https://api.github.com/users/bambery/gists{/gist_id}","starred_url":"https://api.github.com/users/bambery/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bambery/subscriptions","organizations_url":"https://api.github.com/users/bambery/orgs","repos_url":"https://api.github.com/users/bambery/repos","events_url":"https://api.github.com/users/bambery/events{/privacy}","received_events_url":"https://api.github.com/users/bambery/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-07-04T04:02:35Z","updated_at":"2016-07-04T04:02:35Z","closed_at":null,"body":"in https://guides.emberjs.com/v2.6.0/tutorial/service/#toc_accessing-the-google-maps-api\r\n```javascript\r\npinLocation(location, map) {\r\n    this.get('geocoder').geocode({address: location}, (result, status) => {\r\n      if (status === google.maps.GeocoderStatus.OK) {\r\n        let location = result[0].geometry.location;\r\n        let position = { lat: location.lat(), lng: location.lng() };\r\n        map.setCenter(position);\r\n        new google.maps.Marker({ position, map, title: location }); // <------ this throws a console error\r\n      }\r\n    });\r\n  }\r\n```\r\n\r\nThe `title` for creating the new google maps marker is looking for the original string name of the city which was passed in to `pinLocation` via `location` to. However, within the if block, `location` is shadowed to represent a google maps object. When creating the marker, a console error will be thrown `setTitle: not a string`. The maps will still work, but the tooltip on hover will not. If the variable accessing the geometry location is renamed to `loc`, the errors will be gone and the tooltip will work."}}
{"actor":{"display_login":"bambery"}}