Skip to content

Commit 214f24e

Browse files
author
Juan Pablo Scaletti
committed
The root URL for the static map generation is now configurable (using the option)
1 parent 1764bf0 commit 214f24e

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

gmaps.js

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -891,10 +891,16 @@ var GMaps = (function($) {
891891

892892
// Static maps
893893
GMaps.staticMap = function(options){
894-
var static_map_root = 'http://maps.googleapis.com/maps/api/staticmap?';
895894
var parameters = [];
896895
var data;
897896

897+
var static_root = 'http://maps.googleapis.com/maps/api/staticmap';
898+
if (options.url){
899+
static_root = options.url;
900+
delete options.url;
901+
}
902+
static_root += '?';
903+
898904
var markers = options.markers;
899905
delete options.markers;
900906
if (!markers && options.marker){
@@ -906,7 +912,6 @@ var GMaps = (function($) {
906912
delete options.polyline;
907913

908914
/** Map options **/
909-
910915
if (options.center){
911916
parameters.push('center=' + options.center);
912917
delete options.center;
@@ -1043,7 +1048,7 @@ var GMaps = (function($) {
10431048
}
10441049

10451050
parameters = parameters.join('&');
1046-
return static_map_root + parameters;
1051+
return static_root + parameters;
10471052
};
10481053

10491054
//==========================

0 commit comments

Comments
 (0)