mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-06-28 22:30:01 +00:00
google-maps: Use correct type for callback argument
Fixes https://github.com/DefinitelyTyped/DefinitelyTyped/issues/11509 Also, update tests to be more realistic. Signed-off-by: Jon West <jowest@corelogic.com> Signed-off-by: Grant Hutchins <ghutchins@pivotal.io>
This commit is contained in:
committed by
test@corelogic.com
parent
cd6d750c0e
commit
6c6399ea92
@@ -1,9 +1,19 @@
|
||||
|
||||
|
||||
import GoogleMapsLoader = require('google-maps');
|
||||
|
||||
GoogleMapsLoader.load(function(google) {
|
||||
var loadedMap = google.maps.Map;
|
||||
|
||||
GoogleMapsLoader.load(function (google) {
|
||||
var uluru = {lat: -25.363, lng: 131.044};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('map'), {
|
||||
zoom: 4,
|
||||
center: uluru
|
||||
});
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: uluru,
|
||||
map: map
|
||||
});
|
||||
});
|
||||
|
||||
GoogleMapsLoader.KEY = 'qwertyuiopasdfghjklzxcvbnm';
|
||||
@@ -17,11 +27,20 @@ GoogleMapsLoader.LIBRARIES = ['geometry', 'places'];
|
||||
|
||||
GoogleMapsLoader.LANGUAGE = 'fr';
|
||||
|
||||
GoogleMapsLoader.release(function() {
|
||||
GoogleMapsLoader.release(function () {
|
||||
console.log('No google maps api around');
|
||||
});
|
||||
|
||||
GoogleMapsLoader.onLoad(function(google) {
|
||||
var loadedMap = google.maps.Map;
|
||||
console.log('I just loaded google maps api');
|
||||
GoogleMapsLoader.onLoad(function (google) {
|
||||
var uluru = {lat: -25.363, lng: 131.044};
|
||||
|
||||
var map = new google.maps.Map(document.getElementById('map'), {
|
||||
zoom: 4,
|
||||
center: uluru
|
||||
});
|
||||
|
||||
var marker = new google.maps.Marker({
|
||||
position: uluru,
|
||||
map: map
|
||||
});
|
||||
});
|
||||
|
||||
3
google-maps/index.d.ts
vendored
3
google-maps/index.d.ts
vendored
@@ -6,8 +6,9 @@
|
||||
/// <reference types="googlemaps" />
|
||||
|
||||
declare namespace GoogleMapsLoader {
|
||||
type google = { maps: typeof google.maps };
|
||||
interface CallBack {
|
||||
(google: { maps: { Map: google.maps.Map } }): void;
|
||||
(google: google): void;
|
||||
}
|
||||
export var KEY: string;
|
||||
export var CLIENT: string;
|
||||
|
||||
Reference in New Issue
Block a user