Hi,
ich habe es auch versucht nachzubauen. Funktioniert eigentlich - nur das bei mir nur 1 Punkt immer angezeigt wird, obwohl es 2 sein sollten.
mein Quelltext sieht so aus:
Code:
<script type="text/javascript">
<!--//--><![CDATA[//><!--
mapdata = new Array();
mapdata['dlh_googlemap_33'] = new Array();
mapdata['dlh_googlemap_33']['marker'] = new Array();
mapdata['dlh_googlemap_33']['marker'][0] = new Array();
mapdata['dlh_googlemap_33']['marker'][0]['coords'] = '43.8687324, 11.2529013';
mapdata['dlh_googlemap_33']['marker'][0]['icon'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['icon_position'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['icon_size'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['shadow'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['shadow_size'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['infotext'] = '<a href="index.php/fewo-detailasnicht/items/ferienwohnung-1.html" title="Die Details des Eintrags ansehen">Ferienwohnung 1</a>';
mapdata['dlh_googlemap_33']['marker'][0]['info_position'] = '';
mapdata['dlh_googlemap_33']['marker'][0]['autoinfo'] = false;
mapdata['dlh_googlemap_33']['marker'][1] = new Array();
mapdata['dlh_googlemap_33']['marker'][1]['coords'] = '44.4942191, 11.3464815';
mapdata['dlh_googlemap_33']['marker'][1]['icon'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['icon_position'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['icon_size'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['shadow'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['shadow_size'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['infotext'] = '<a href="index.php/fewo-detailasnicht/items/ferienhaus-1.html" title="Die Details des Eintrags ansehen">Ferienhaus 1</a>';
mapdata['dlh_googlemap_33']['marker'][1]['info_position'] = '';
mapdata['dlh_googlemap_33']['marker'][1]['autoinfo'] = false;
//--><!]]>
</script>
Und das modul später dann:
Code:
div class="dlh_googlemap block" id="dlh_googlemap_33" style="width:450px;height:300px;display:block;"></div>
<script type="text/javascript">
//<![CDATA[
if (typeof(mapdata) == 'undefined') {
mapdata = new Array();
}
if (typeof(mapdata['dlh_googlemap_33']) == 'undefined') {
mapdata['dlh_googlemap_33'] = new Array();
}
if (typeof(mapdata['dlh_googlemap_33']['marker']) == 'undefined') {
mapdata['dlh_googlemap_33']['marker'] = new Array();
}
if (typeof(mapdata['dlh_googlemap_33']['zoom']) == 'undefined') {
mapdata['dlh_googlemap_33']['zoom'] = '6';
}
if (typeof(mapdata['dlh_googlemap_33']['coords']) == 'undefined') {
mapdata['dlh_googlemap_33']['coords'] = '43.7687324, 11.2569013';
}
//]]>
</script>
<script src="http://maps.google.com/maps?file=api&v=2&key=&sensor=false&hl=de" type="text/javascript"></script>
<script type="text/javascript">
//<![CDATA[
function loaddlh_googlemap_33() {
if (GBrowserIsCompatible()) {
var dlh_googlemap_33 = new GMap2(document.getElementById("dlh_googlemap_33"));
dlh_googlemap_33.addControl(new GSmallMapControl());
dlh_googlemap_33.addControl(new GMapTypeControl());
dlh_googlemap_33.removeMapType(G_HYBRID_MAP);
dlh_googlemap_33.setMapType(G_NORMAL_MAP);
coords = mapdata['dlh_googlemap_33']['coords'].split(',');
dlh_googlemap_33.setCenter(new GLatLng(coords[0],coords[1]), 1*mapdata['dlh_googlemap_33']['zoom']);
Was mache ich falsch?
Gruss Gassi
Lesezeichen