Inhalte aufrufen


GoogleMap2 1.3 Modul

Modul GoogleMap

4 Antworten zu diesem Thema

#1 Burner0815

    Member

  • Members
  • 10 Beiträge

Geschrieben: 12 Februar 2012 - 13:51

Hallo,

das Modul fügt das Script im Header mitten in den DocType ein:
<!DOCTYPE html PU<script src="... kann mir jemand sagen was hier zu tun ist?

Grüße Andi

#2 bjoern

    Administrator

  • Administrators
  • 68 Beiträge

Geschrieben: 13 Februar 2012 - 13:38

Welches GoogleMaps Modul nimmst Du den?

Generell hat sich das Einfügen von Headerinformationen im CMS grundlegend geändert. Das geht jetzt folgendermaßen:

<CMSPHP>
$o = sf_api('LIB', 'FrontendOutput');
$o->addJs('path/to/myJavascriptFile.js');
//geht auch
// $o->addCss($file, $attributes = '', $position = 'bottom');
// $o->addContentToContainer($nr, $content, $position = 'bottom')
// $o->changeContainerVisibility($container, $is_visible = TRUE)
// $o->setTitle($val);
</CMSPHP>


#3 Burner0815

    Member

  • Members
  • 10 Beiträge

Geschrieben: 13 Februar 2012 - 23:59

Ich benutze das GoogleMap2, 1.3 Modul. Hiermal die Frontendausgabe. Was muss verändert werden das am ende des Headers eingebunden wird?

<CMSPHP>
//Beginn GoogleMapApi
/**
* Project:	 GoogleMapAPI: a PHP library inteface to the Google Map API
* File:		GoogleMapAPI.class.php
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*
* For questions, help, comments, discussion, etc., please join the
* Smarty mailing list. Send a blank e-mail to
* smarty-general-subscribe@lists.php.net
*
* @link http://www.phpinsider.com/php/code/GoogleMapAPI/
* @copyright 2005 New Digital Group, Inc.
* @author Monte Ohrt <monte at ohrt dot com>
* @package GoogleMapAPI
* @version 2.5
*/
/* $Id: GoogleMapAPI.class.php,v 1.63 2007/08/03 16:29:40 mohrt Exp $ */
/*
For best results with GoogleMaps, use XHTML compliant web pages with this header:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:v="urn:schemas-microsoft-com:vml">
For database caching, you will want to use this schema:
CREATE TABLE GEOCODES (
  address varchar(255) NOT NULL default '',
  lon float default NULL,
  lat float default NULL,
  PRIMARY KEY  (address)
);
*/
class GoogleMapAPI {
	/**
	 * PEAR::DB DSN for geocode caching. example:
	 * $dsn = 'mysql://user:pass@localhost/dbname';
	 *
	 * @var string
	 */
	var $dsn = null;
  
	/**
	 * YOUR GooglMap API KEY for your site.
	 * (http://maps.google.com/apis/maps/signup.html)
	 *
	 * @var string
	 */
	var $api_key = '';
	/**
	 * current map id, set when you instantiate
	 * the GoogleMapAPI object.
	 *
	 * @var string
	 */

.
.
.
.



// create some map markers
$map->addMarkerByAddress('MOD_VALUE[1]','MOD_VALUE[2]','MOD_VALUE[3]');
//$map->printHeaderJS();
$head=$map->getHeaderJS();
//$map->printMapJS();
$head.= $map->getMapJS();
//$map->printOnLoad();
$head.= $map->getOnLoad();
//echo "<div id=\"map\"></div>";
$map->printMap();
$link2_head = array($head);
  
			$mod['manipulate_output']  = '$magic = "<!--END head//-->";';
			$mod['manipulate_output'] .= '$start = strpos($output, $magic) + strlen($magic);';
			$mod['manipulate_output'] .= '$new_output  = substr($output, 0, $start);';
			$mod['manipulate_output'] .= '$new_output .= implode("", $link2_head);';
			$mod['manipulate_output'] .= '$new_output .= substr($output, $start);';
			$mod['manipulate_output'] .= '$output = $new_output;';
			$cfg_client['manipulate_output'] = $mod['manipulate_output'] . $cfg_client['manipulate_output'];
</CMSPHP>


#4 bjoern

    Administrator

  • Administrators
  • 68 Beiträge

Geschrieben: 15 Februar 2012 - 12:52

Bitte nicht den gesamten Modulcode hier reinposten. Das ist arg unübersichtlich und bringt keinen Mehrwert. Niemand wird Dir aus den 1000 Zeilen Sourcecode mal so eben auf die Schnelle und ungetestet eine Lösung sagen können. Eine genaue Bezeichnung von Modul und Version, eventuell ein Link zum Download und jeder weiß, worum es geht. :) Ansonsten hoffe ich, dass Ihr euch hier untereinander weiterhelfen könnt, ich hab für so etwas leider keine Zeit, mein zu Hause ist der BugTracker (würde aber auch tauschen ;) )

Anmerkung von mir: Das Modul nutzt die "veraltete" GoogleMaps 2 API. Ein Sefrengo 1.4 Modul, welches die GoogleMaps3 API anspricht findest Du hier: http://archive-forum...?showtopic=3125 . Ich würde das als Grundlage nehmen.

#5 Burner0815

    Member

  • Members
  • 10 Beiträge

Geschrieben: 15 Februar 2012 - 17:14

Besten Dank für den Tip :) hab auf das GoogleMaps Modul gewechselt.