場所を検索する単純なアプリを作成しようとしていますが、実行しようとするとReferenceErrorが発生します。私の現在のコードはGoogleチュートリアルから直接取得されているため、何が欠けているのかわかりません。
function myFunction()
{
var map;
var service;
var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316);
map = new google.maps.Map(document.getElementById('map'), {
mapTypeId: google.maps.MapTypeId.ROADMAP,
center: pyrmont,
zoom: 15
});
var request = {
location: pyrmont,
radius: '500',
types: ['store']
};
service = new google.maps.places.PlacesService(map);
service.search(request, callback);
}
私が得るエラーは「ReferenceError:"google"が定義されていません。」です。この行に
var pyrmont = new google.maps.LatLng(-33.8665433,151.1956316);
ある種のインクルードのような単純なものだと思いますが、途方に暮れています。