Hi,
I just read about the Google Maps API and found out that there are many ways to change appearence and behavior of a Google Maps. Thanks to this great module I was able to create a view showing some location nodes with markers on it. I want to use view for my map as I need filters for my users so that they can filter the results.
Now I want to achieve some things and I still did not find the best solution how to get this:
- the users should have an input field where they can fill in a place - the map should be centered there where the coordinates came from Google Places API
- when a user clicks into the map he should see a window giving the node add form and using the coordianes if the placed marker as the coordinates of the node
- when the view has no result the user should see a map
What I exactly need: are there some hooks which I can use to change some settings for a specific map - and maybe add some JavaScript like event listener? How can I additionally get this map in JavaScript when I want to write some custom JavaScript?
Best,
Tobias
Comments
Comment #1
arne_hortell commentedHere it is,
function mymodule_map_gmap($op, &$map) {
switch ($op) {
case 'pre_theme_map':
if ($map['id'] == 'auto1map') {
$line_array = array();
if ($map['markers'] != NULL) {
foreach ($map['markers'] as $key => $marker) {
$line_array[$key] = array(
0 => $marker['latitude'],
1 => $marker['longitude']
);
}
}
$map['shape'] = array(
0 => array(
'style' => array('ff0000', 5, 80, '00ff00', 60),
'type' => 'line',
'points' => $line_array
)
);
}
}
}
its meant to be working but for any reason it doesnt make it possible for me to draw lines using map['shape'][0]['points']
Any ideas why it doesnt work for me?