diff --git a/README.md b/README.md index 0d10e551b..29c94b804 100755 --- a/README.md +++ b/README.md @@ -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)) diff --git a/googlemaps.infobubble/google.maps.infobubble-tests.ts b/googlemaps.infobubble/google.maps.infobubble-tests.ts new file mode 100644 index 000000000..e555625d8 --- /dev/null +++ b/googlemaps.infobubble/google.maps.infobubble-tests.ts @@ -0,0 +1,30 @@ +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(); +} \ No newline at end of file diff --git a/googlemaps.infobubble/google.maps.infobubble.d.ts b/googlemaps.infobubble/google.maps.infobubble.d.ts new file mode 100644 index 000000000..f65dd1114 --- /dev/null +++ b/googlemaps.infobubble/google.maps.infobubble.d.ts @@ -0,0 +1,103 @@ +/// + +// 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; + } +} \ No newline at end of file