Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gmap
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
gmap
Commits
4c9cb98b
Commit
4c9cb98b
authored
11 years ago
by
johnv
Committed by
podarok
11 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Issue #1945102 by johnv | ggarry: Fixed Drupal.ajax.prototype error.
parent
43b9e2fb
No related branches found
Branches containing commit
Tags
6.x-2.0-beta1
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gmap.module
+26
-8
26 additions, 8 deletions
gmap.module
with
26 additions
and
8 deletions
gmap.module
+
26
−
8
View file @
4c9cb98b
...
...
@@ -241,8 +241,7 @@ function _gmap_base_js() {
$ret
[
$path
.
'/js/icon.js'
]
=
array
(
'weight'
=>
2
);
$ret
[
$path
.
'/js/marker.js'
]
=
array
(
'weight'
=>
2
);
$ret
[
$path
.
'/js/highlight.js'
]
=
array
(
'weight'
=>
2
);
$ret
[
$path
.
'/js/poly.js'
]
=
array
(
'weight'
=>
3
);
$ret
[
$path
.
'/js/gmap_views_ajax.js'
]
=
array
(
'weight'
=>
3
);
$ret
[
$path
.
'/js/poly.js'
]
=
array
(
'weight'
=>
2
);
global
$language
;
$file
=
'api/js'
;
...
...
@@ -259,26 +258,26 @@ function _gmap_base_js() {
// There is no https:// version of this domain, so this can be hard coded.
$ret
[
url
(
'http'
.
'://ditu.google.cn/maps/'
.
$file
,
array
(
'query'
=>
$query
))]
=
array
(
'type'
=>
'external'
,
'weight'
=>
2
,
'weight'
=>
1
,
);
}
elseif
(
$query
[
'language'
]
==
'zh-hant'
)
{
$query
[
'language'
]
=
'zh-TW'
;
$ret
[
url
(
gmap_views_protocol
()
.
'://maps.googleapis.com/maps/'
.
$file
,
array
(
'query'
=>
$query
))]
=
array
(
'type'
=>
'external'
,
'weight'
=>
2
,
'weight'
=>
1
,
);
}
else
{
$ret
[
url
(
gmap_views_protocol
()
.
'://maps.googleapis.com/maps/'
.
$file
,
array
(
'query'
=>
$query
))]
=
array
(
'type'
=>
'external'
,
'weight'
=>
2
,
'weight'
=>
1
,
);
}
$ret
[
'/'
.
variable_get
(
'file_public_path'
,
conf_path
()
.
'/files'
)
.
'/js/gmap_markers.js'
]
=
array
(
'type'
=>
'external'
,
'weight'
=>
2
,
'weight'
=>
4
,
);
return
$ret
;
...
...
@@ -612,7 +611,26 @@ function gmap_element_info() {
}
/**
* Pre render function to make sure all required JS is available.
* Implementation of hook_views_pre_render().
* Pre render function to load ajax-js file, which is only possible if ajax is enabled in the display.
*/
function
gmap_views_pre_render
(
&
$view
)
{
static
$gmap_processed
=
FALSE
;
// Add js only for gmap style views with ajax and not already processed.
if
((
$view
->
plugin_name
!=
'gmap'
&&
$view
->
plugin_name
!=
'gmapextended'
)
||
(
!
$view
->
use_ajax
)
||
$gmap_processed
)
{
return
;
}
// Mark the view as already processed.
$gmap_processed
=
TRUE
;
// Add js, now we are certain ajax is enabled.
drupal_add_js
(
drupal_get_path
(
'module'
,
'gmap'
)
.
'/js/gmap_views_ajax.js'
,
array
(
'group'
=>
JS_DEFAULT
));
}
/**
* Pre render function to make sure all required JS is available, depending on the display's behavior.
*/
function
_gmap_pre_render_map
(
$element
)
{
$path
=
drupal_get_path
(
'module'
,
'gmap'
);
...
...
@@ -653,7 +671,7 @@ function _gmap_pre_render_map($element) {
}
if
(
isset
(
$mms
[
$mm
][
'filename'
]))
{
$element
[
'#attached'
][
'js'
][
$path
.
'/thirdparty/js/'
.
$mms
[
$mm
][
'filename'
]]
=
array
(
'weight'
=>
3
);
$element
[
'#attached'
][
'js'
][
$path
.
'/thirdparty/js/'
.
$mms
[
$mm
][
'filename'
]]
=
array
(
'weight'
=>
5
);
}
$element
[
'#attached'
][
'js'
][
$path
.
'/js/'
.
$mm
.
'_marker.js'
]
=
array
(
'weight'
=>
5
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment