Merge pull request #1750 from Dashue/googlemaps.infobubble

Added definitions for googlemaps.infobubble
This commit is contained in:
Bart van der Schoor
2014-02-27 01:36:27 +01:00
3 changed files with 137 additions and 0 deletions
+1
View File
@@ -97,6 +97,7 @@ List of Definitions
* [Google API Client](https://code.google.com/p/google-api-javascript-client/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google App Engine Channel API](https://developers.google.com/appengine/docs/java/channel/javascript) (by [vvakame](https://github.com/vvakame))
* [GoogleMaps](https://developers.google.com/maps/) (by [Esben Nepper](https://github.com/eNepper))
* [GoogleMaps InfoBubble](http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/) (by [Johan Nilsson](https://github.com/dashue))
* [Google Geolocation](https://code.google.com/p/geo-location-javascript/) (by [Vincent Bortone](https://github.com/vbortone))
* [Google Page Speed Online API](https://developers.google.com/speed/pagespeed/) (by [Frank M](https://github.com/sgtfrankieboy))
* [Google Translate API](https://developers.google.com/translate/) (by [Frank M](https://github.com/sgtfrankieboy))
@@ -0,0 +1,33 @@
/// <reference path="../googlemaps/google.maps.d.ts" />
/// <reference path="google.maps.infobubble.d.ts" />
function test_options() {
var options: google.maps.infobubble.InfoBubbleOptions;
options = {};
options.arrowPosition = 50;
options.arrowSize = 15;
options.arrowStyle = 0;
options.backgroundColor = "#000";
options.borderColor = "#000";
options.borderRadius = 5;
options.borderWidth = 1;
options.disableAnimation = false;
options.disableAutoPan = false;
options.maxHeight = 300;
options.maxWidth = 300;
options.minHeight = 300;
options.minWidth = 300;
options.padding = 10;
options.shadowStyle = 1;
}
function test_bubble() {
var map: google.maps.Map;
var marker: google.maps.Marker;
var bubble: google.maps.infobubble.InfoBubble;
bubble.open(map, marker);
var isOpen = bubble.isOpen();
bubble.close();
}
+103
View File
@@ -0,0 +1,103 @@
/// <reference path="../googlemaps/google.maps.d.ts" />
// Type definitions for CSS3 InfoBubble with tabs for Google Maps API V3
// Project: http://google-maps-utility-library-v3.googlecode.com/svn/trunk/infobubble/src/
// Definitions by: Johan Nilsson https://github.com/Dashue
// Definitions: https://github.com/borisyankov/DefinitelyTyped
/**
* @name CSS3 InfoBubble with tabs for Google Maps API V3
* @version 0.8
* @author Luke Mahe
* @fileoverview
* This library is a CSS Infobubble with tabs. It uses css3 rounded corners and
* drop shadows and animations. It also allows tabs
*/
/*
The MIT License
Copyright (c) 2014 https://github.com/Dashue
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
declare module google.maps.infobubble {
export interface InfoBubble {
/**
* Closes the infobubble
*/
close(): void;
/**
* Checks if the infobubble is currently open
*/
isOpen(): boolean;
/**
* Opens the infobubble
* @map The google map object
* @marker The marker used for anchoring the infobubble to
*/
open(map: google.maps.Map, marker: google.maps.Marker) : void;
}
export interface InfoBubbleOptions {
/**
* Percentage from the bottom left corner of the infobubble
*/
arrowPosition?: number;
arrowSize?: number;
/**
* 0: Middle, 1: Left, 2: Right
*/
arrowStyle?: number;
backgroundColor?: string;
borderColor?: string;
borderRadius?: number;
borderWidth?: number;
disableAnimation?: boolean;
disableAutoPan?: boolean;
maxHeight?: number;
maxWidth?: number;
minHeight?: number;
minWidth?: number;
padding?: number;
/**
* 0: None, 1: Right, 2: Under
*/
shadowStyle?: number;
}
}