1
0
Fork 0
forked from 0x2620/oxjs

pass api key to map

This commit is contained in:
j 2017-05-29 17:56:03 +02:00
commit 39e4224034
2 changed files with 6 additions and 0 deletions

View file

@ -7,6 +7,7 @@ Ox.Map <f> Basic map object
API](http://code.google.com/apis/maps/documentation/javascript/).
# ARGUMENTS ----------------------------------------------------------------
options <o|{}> options
apiKey <s> Google API Key
clickable <b|false> If true, clicking on the map finds a place
editable <b|false> If true, places are editable
find <s|""> Initial query
@ -88,6 +89,7 @@ Ox.Map = function(options, self) {
var that = Ox.Element({}, self)
.defaults({
// fixme: isClickable?
apiKey: '',
clickable: false,
editable: false,
find: '',
@ -524,6 +526,7 @@ Ox.Map = function(options, self) {
$.getScript(
document.location.protocol
+ '//maps.google.com/maps/api/js?callback=googleCallback&sensor=false'
+ (options.api_key ? '&key=' + options.apiKey : '')
);
}