File tree Expand file tree Collapse file tree
xoops_trust_path/modules/xpwiki/plugin Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ function plugin_gmap_init () {
162162 $ this ->cont ['PLUGIN_GMAP_PROFILE ' ] = 'default ' ;
163163
164164 // This plugins config
165- $ this ->conf ['ApiVersion ' ] = '2 ' ;
165+ $ this ->conf ['ApiVersion ' ] = '3 ' ;
166166
167167 if ($ this ->cont ['UA_PROFILE ' ] === 'mobile ' ) {
168168 $ this ->conf ['StaticMapSizeW ' ] = 480 ;
@@ -934,7 +934,10 @@ function plugin_gmap_get_maptype($type) {
934934 }
935935
936936 function plugin_gmap_init_output ($ key ) {
937- $ this ->func ->add_js_head ('//maps.google.com/maps/api/js?sensor=true&libraries=places&key= ' .$ key , true , 'UTF-8 ' );
937+ if (floatval ($ this ->conf ['ApiVersion ' ]) < 3 ) {
938+ $ this ->conf ['ApiVersion ' ] = '3 ' ;
939+ }
940+ $ this ->func ->add_js_head ('//maps.google.com/maps/api/js?v= ' .$ this ->conf ['ApiVersion ' ].'&sensor=true&libraries=places&key= ' .$ key , true , 'UTF-8 ' );
938941 $ this ->func ->add_tag_head ('gmap.js ' );
939942 return ;
940943 }
You can’t perform that action at this time.
0 commit comments