I am on a 5.x site, and have installed both the location module and the gmap module. I have configured the locations module, the gmap areas, and built a gmap macro.

There is a page on our site, where we need a map to show up with the map as it's been configured in those areas. The map shows up when I put the code snipet in from the google map API page. The map displays as I need it to. What does not display is the point on the map. I have searched the documentation and the other postings for how to make this show up, and cannot find what I am looking for. I did find something about making a CCK nodetype and fields, but I can't find a field type that has anything to do with gmaps or maps/locations in general.

We just need to display one point on the map. Where our offices are. Any suggestions?

Thanks, in advance...

Comments

anawillem’s picture

StatusFileSize
new287.46 KB
new219.24 KB
new254.94 KB
new188.45 KB
new418.18 KB

when you see 'find_us' i put that in as a last ditch effort...used to have something like:
[gmap|id=locmap|center=33.93358,-84.294816|zoom=3|width=100%|height=400px]
[gmap markers=drupal::33.92961641183505,-84.29431915283203 |zoom=14 |center=33.92762234689565,-84.2937183380127 |width=450px |height=400px |control=Large |type=Map]

i appreciate the help.

robertguerra’s picture

Component: Documentation » Code

doesn't work anymore for me either.

mcantelon’s picture

Are all the necessary Javascripts getting included?

v5 version of GMap requires more Javascript includes than the v4.

I ran into this issue.

-Mike

crandell’s picture

On my site, the markers don't show up in the www version. They only show up at http://domain.com. Have you tried that?

tom_o_t’s picture

Assigned: Unassigned » tom_o_t
Priority: Critical » Normal

I suspect that the problem is to do with your input filters.

For the GMap Macro to be turned into a map you have to change your input filter to include the GMap macro filter.

Go to your input formats config page at admin/settings/filters
Click 'configure' next to the input format that will be used for the content where the map is to be included (typically filtered HTML)
Check 'GMap filter' and save

Now when you insert a gmap macro into a page it should automatically turn into the map with your marker.

If this solves your problem please come back to this support request and change the status to closed. Good luck!

jenlampton’s picture

Version: 5.x-1.x-dev » 5.x-1.0-alpha1
Assigned: tom_o_t » Unassigned
Category: support » bug

My markers aren't showing either, and I'm not using a macro. I'm printing my_theme_node_map_maker() directly into $vars['content'] and the map shows correctly, but no marker. The only documentation I could find on how to programmatically print a marker on a map was from this post How To: Custom Maps on Each Node But I wonder if this syntax is correct...

Mark Linden’s picture

same here - have you found the fix?

pbarnett’s picture

Which browser are people having problems with?

I found that though the maps were fine in FireFox, the markers didn't show up until I modified page.tpl.php to include

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">

in the page header.

See http://mongolia.charityrallies.org/en/cr_maps_routes

Pete.

Mark Linden’s picture

Running 5.7 with the latest GMap beta.
XP all browsers = markers present
Mac Safari = markers present
Mac Firefox = map only, no markers (note: recent log entry of "undefined/markers")
Mac Firefox without www in url = markers present

bdragon’s picture

@ #9: You sure mac firefox wasn't caching? http://drupal.org/cvs?commit=116996 should have fixed domain specific issues for good...

Mark Linden’s picture

could certainly have been a case of ff caching.....although I started seeing markers again (at the www level) only after deleting and reinstalling the GMAP module. Maybe left-over code from previously installing & subsequent uninstalling of the Dev & Add-on's modules?

shenzhuxi’s picture

Version: 5.x-1.0-alpha1 » 5.x-1.0-beta2

I use Drupal 5.8 and 5.7, gmap beta2, latest location and view. I can use gmap for latitude and longitude. But no markers showed on gmap view.
see hotopeople.com/?q=map/node

I can't add markers, draw lines on the "Build a GMap macro" too.
see http://hotopeople.com/?q=map/macro

However, I embedded a macro in the content for test. Lines and polygons can be display but not markers.
see http://hotopeople.com/?q=node/1

gagarine’s picture

I use location and gmap. I display map with contemplate http://drupal.org/node/177963#comment-853158 After the update the marker are not any more displaying.

summit’s picture

Subscribing, greetings, Martijn

pbarnett’s picture

Version: 5.x-1.0-beta2 » 5.x-1.x-dev

Markers, custom markers, lines and rollovers all working fine using 5.x-1.x-dev and a few lines of custom code...

See http://mongolia.charityrallies.org/en/teams/blogs for a map of SMS blogs!

Pete.

shenzhuxi’s picture

"a few lines of custom code" is what needed for close this bug. Can you post them?

pbarnett’s picture

Hi.

This is the code I'm using on http://mongolia.charityrallies.org/en/teams/blogs using GMap 5.x-1.x-dev :-

<?php
function cr_maps_buildmarker($row, $markerstyle = 'small blue', $teamblog = 0) {
  $gid = $row['gid'];
	$body = $row['body'];
	$comment  = strftime('%a %d %b %H:%M',$row['created']);
	$comment .= "<p>$body</p>";
	if(!$teamblog) $comment .= "<p>See their <a href=\"/teams/$gid/blogs/map\">blog</a>...</p>";
	$caption = ($teamblog) ? $row['title'] : $row['team'];
	$date = $row['created'];
	$fdate = 'posted on ' . format_date($date, 'custom', "l, F jS Y \a\\t H:i");
	$gid = ($teamblog) ? $row['nid'] : $row['gid'];
	$back = ($teamblog) ? "<p><a href=\"/teams/blogs\">Main blog map</a>" : '';
	$html = "<div class=\"maphtml\"><h5><a href=\"/node/$gid\">$caption</a></h5><p>$comment</p>$back</div>";
	$marker = array();
	$marker['text'] = $html;
	$marker['markername'] = $markerstyle;
	$marker['offset'] = 0;
	$marker['latitude'] =  $row['lat'];
	$marker['longitude'] = $row['lon'];
	$marker['autoclick'] = false;
	$marker['opts']['title'] = "$caption; $fdate"; // Displays on marker rollover. Cool!
	
	return $marker;
}

function cr_maps_team_blog_map($view, $nodes, $type) {
	$settings = cr_maps_default_settings();
  $colours = array(	'#515cee', '#ff00ff', '#ff0000', 
										'#009113', '#00ff00', '#67ccfe', 
										'#fe9902', '#9900cc', '#fefe35', 
									);
	
  $mstyles = array(	'small blue', 'small bpink', 'small bred', 
										'small dgreen', 'small fgreen', 'small lblue',
										'small orange', 'small purple', 'small yellow',
									);
  $lwidth = variable_get('cr_maps_line_width', 2);  
	$markers = array();
	
	$node = node_load($nodes[0]->nid);
	$gnid = $node->og_groups[0];
	// create polyline
	$idx = $gnid % 9;
	$colour = $colours[$idx];
	$style = $mstyles[$idx];

	$settings['shapes'][0]['type'] = 'line';
	$settings['shapes'][0]['style'] = array($colour, $lwidth, 0.75);
	$settings['shapes'][0]['points'] = array();	

	foreach($nodes as $n) {
		$nid = $n->nid;
		$node = node_load($nid);
		$row['lat'] = $lat = $node->location['lat'];
		$row['lon'] = $lon = $node->location['lon'];
		if($lat and $lon) {
			$settings['shapes'][0]['points'][] = array($lat, $lon);
			$row['body'] = $node->teaser;
			$row['created'] = $node->created;
			$row['team'] = $node->og_groups_both[$gnid];
			$row['gid'] = $gnid;
			$row['nid'] = $nid;			
			$row['title'] = $node->title;
			$markers[] = cr_maps_buildmarker($row, $style, true);
		}
	}
	$settings['markers'] = $markers;
	return theme('gmap', array('#settings' => $settings));
}
?>
shenzhuxi’s picture

Status: Active » Fixed

Finally, I got it.

Gmap 5.x-1.x-dev create a file markerdata.js at yourdomain/?q=map/markerdata.js. But the module assume that the clean urls is turned on, so ref "yourdomain/map/markerdata.js".

Solution:
If your host doesn't support clean url, change gmap.module line 80 into "drupal_add_js('?q=map/markerdata.js');"

Fixed?!

bdragon’s picture

Status: Fixed » Active

It ain't fixed until the fix is in cvs.

Good catch, I'll have it patched up in a moment..

bdragon’s picture

Status: Active » Fixed
gagarine’s picture

Yeah i confirme it work like a charme :)

vangorra’s picture

I'm using 5.x-1.x-dev and none of my markers are showing up. I am creating a gmap array and trying to have that show up. Here it is..
Array
(
[id] => report-map
[maptype] => Map
[width] => 600px
[height] => 500px
[controltype] => Large
[align] => Left
[mtc] => none
[baselayers] => Array
(
[Map] => 1
[Satellite] => 1
[Hybrid] => 1
)

[autozoom] => 1
[latitude] => 21.2990
[longitude] => -157.6990
[behavior] => Array
(
[locpick] =>
[nodrag] =>
[nokeyboard] => 1
[overview] =>
[scale] => 1
)

[markers] => Array
(
[0] => Array
(
[text] => TEXT
[longitude] => 47.5750
[latitude] => -122.3930
[markername] => green
)

[1] => Array
(
[text] => TEXT
[longitude] => 48.1040
[latitude] => -122.7940
[markername] => green
)

[2] => Array
(
[text] => TEXT
[longitude] => 21.2990
[latitude] => -157.6990
[markername] => green
)
)
)

vangorra’s picture

EEEK! Nevermind, I was being stupid and reversed the lat/lon.. Ignore my post please.

Anonymous’s picture

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.

alextronic’s picture

Yes sir, this was it!