Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-01-19 13:38:07

HansB
New Member
Registered: 2011-01-19
Posts: 4

GoogleMaps_module

Hello,

I am realitve new in textpattern, but I have got a problem with the GoogleMaps_module.

On the page http://www.alumatzeeman.nl/nl/directions/

I would like to see a print of the map between the lines. The key of Google is correct (tested in another page without textpattern CMS).

Please help……..

Kind regards,
Hans Boeters

Offline

#2 2011-01-19 15:28:30

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: GoogleMaps_module

By module, do you mean you are incorporating Google Maps manually (and are using module as the term for that chuck of code) or that you are using a plugin?

If a plugin, the two most likely culprits would be rss_google_map or msd_google_map.

Just trying to help clarify :)

Last edited by maverick (2011-01-19 15:31:48)

Offline

#3 2011-01-19 15:39:20

HansB
New Member
Registered: 2011-01-19
Posts: 4

Re: GoogleMaps_module

The module I see is an own (by a previous developer) created piece of code:

<txp:php>			
	switch ($_SERVER['HTTP_HOST']) {
			case 'alumat.testground.nl': 
				$mapkey = 'ABQIAAAAJDo1_T12ztdEBQDbFxpM9xQYByoVCA2CU5TYBVAyzlINHfGLnhRDnYxVZglKcHYvYcjiQsHUOvRc2Q';
			break;

			case 'www.alumathasin.nl': 
				$mapkey = 'ABQIAAAAJDo1_T12ztdEBQDbFxpM9xTjGW6LRAj0uV-sduBT2o1xaBLgrRRr6ngkXidVFKU71ypd9bGzgOoLwQ';
			break;

			case 'www.alumat.nl': 
				$mapkey = 'ABQIAAAAJDo1_T12ztdEBQDbFxpM9xToL3Jo8VAp4RTWTwDEp5UUCa5tExTJHUF6sHZ4mfTVY-4TWk7wZdTCpw';
			break;

			case 'www.alumatzeeman.nl': 
				$mapkey = 'ABQIAAAA40bC3KwzE6F1yp0vqF2mbxRplxXHKjrHizm4BgNs7nLxRHuHBRQCr3vSiNQniF_Yl5D7XsoTSNOeJQ';
			break;	
		}
		echo '<script type="text/javascript" src="http://maps.google.com/maps?file=api&amp;v=2&amp;hl=<txp:l10n_get_lang type=\'short\' />&amp;key='.$mapkey.'"></script>';
</txp:php>


<script type="text/javascript">

//<![CDATA[
window.addEvent('domready', function load() {
	if (GBrowserIsCompatible()) {
	var map = new GMap2(document.getElementById("map"));
	map.setCenter(new GLatLng(51.954008, 4.229706), 14);
	map.setMapType(G_HYBRID_MAP);

	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());

	var point = new GLatLng(51.954008, 4.229706);
	map.addOverlay(new GMarker(point));

	}
});

window.addEvent('unload', GUnload);   

//]]>

</script>

<div id="map"></div>
	<form action="http://maps.google.nl/maps" method="get" target="_blank" class="plainform">
		<fieldset>
		<input name="daddr" type="hidden" value="Aartsdijkweg 9-11, 2676 LE Maasdijk" />
		<input name="hl" type="hidden" value="<txp:l10n_get_lang type='short' />" />
		<label><strong>##google_postcode##</strong></label><input id="saddr" name="saddr" class="breed" type="text" />
		<p class="formbuttons"><input class="button" type="submit" value="##google_toonroute##" /></p>
		</fieldset>
	</form>

Keep in mind, that the site is www.alumatzeeman.nl

Thanks in advance for your help.

(edited to add bc.. for better code display. -Els)

Last edited by els (2011-01-19 20:24:41)

Offline

#4 2011-01-19 17:00:15

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: GoogleMaps_module

window.addEvent is a MooTools function but you have MooTools commented out on that page. Try removing the comments around this

<!-- <script type="text/javascript" src="http://www.alumatzeeman.nl/js-css/mootools.v1.11.js"></script> -->

And by the way (@maverick) msd_google_maps is Admin Side only.

Last edited by MattD (2011-01-19 17:00:58)


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#5 2011-01-19 17:11:34

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: GoogleMaps_module

MattD wrote:

And by the way (@maverick) msd_google_maps is Admin Side only.

Of course. I had forgotten that.

Thanks Matt.

Offline

#6 2011-01-19 17:21:12

wornout
Member
From: Italy
Registered: 2009-01-20
Posts: 256
Website

Re: GoogleMaps_module

When I use Google Maps I usually do this steps:

In the head of document load Google API

<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

Create a form with Google Maps script

<script type="text/javascript">
  function initialize() {
    var myLatlng = new google.maps.LatLng(00.000000, 00.000000);
    var myOptions = {
      zoom: 13,
      center: myLatlng,
      navigationControl: true,
      scaleControl: true,
      mapTypeId: google.maps.MapTypeId.ROADMAP
    }
    var map = new google.maps.Map(document.getElementById("map"), myOptions);  
    var marker = new google.maps.Marker({
        position: myLatlng, 
        map: map
    });
  }
</script>

Change body tag

<body onload="initialize()">

Last edited by wornout (2011-01-19 17:32:19)

Offline

#7 2011-01-19 17:27:58

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: GoogleMaps_module

wornout wrote:

When I use Google Maps I usually do this steps:

He’s pretty much doing the same thing. He’s just using php to pick the google key to use based on the url of the site. And he’s using MooTools for the onload but he has MooTools commented out.

Unless the key is no longer required your example is missing it.

Going to his page and running the script he has in his MooTools window.addEvent function makes the map show up so it confirms that’s the problem.


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#8 2011-01-19 23:23:25

GugUser
Member
From: Quito (Ecuador)
Registered: 2007-12-16
Posts: 1,477

Re: GoogleMaps_module

Normally I determine the map cutout in Google map, then I click “Link”. Then I can still make individual adjustments and finally copy the code.

Offline

#9 2011-01-20 07:14:46

HansB
New Member
Registered: 2011-01-19
Posts: 4

Re: GoogleMaps_module

Thanks for the help……..

I enabled the script motools, but it still does not work……..

Offline

#10 2011-01-20 07:19:30

MattD
Plugin Author
From: Monterey, California
Registered: 2008-03-21
Posts: 1,254
Website

Re: GoogleMaps_module

It works for me at the link from above. Maybe your viewing a cached version?


My Plugins

Piwik Dashboard, Google Analytics Dashboard, Minibar, Article Image Colorpicker, Admin Datepicker, Admin Google Map, Admin Colorpicker

Offline

#11 2011-01-20 08:13:39

HansB
New Member
Registered: 2011-01-19
Posts: 4

Re: GoogleMaps_module

Thanks Matt,

It works fine in FireFox, but not in IE……..

Thanks,
Hans

Offline

Board footer

Powered by FluxBB