name.$this->id.'.invalidateSize(); }, 0);});'; $app = Factory::getApplication(); if ($app->input->get( 'print', '', 'int' ) == 1 || $app->input->get( 'tmpl', '', 'string' ) == 'component') { $foutput = '
'; echo '
'; } else { echo '
'; if ( $this->t['p']->def( 'show_page_heading', 1 ) ) { echo '

'. $this->t['p']->get('page_heading') . '

'; } $foutput = PhocaMapsHelper::getExtInfo(); } if ((!isset($this->map->longitude)) || (!isset($this->map->latitude)) || (isset($this->map->longitude) && $this->map->longitude == '') || (isset($this->map->latitude) && $this->map->latitude == '')) { echo '

' . Text::_('COM_PHOCAMAPS_MAP_ERROR_FRONT') . '

'; } else { echo $this->t['description']; $id = uniqid(); $map = new PhocaMapsMapOsm($id); //$map->loadAPI(); //$map->loadGeoXMLJS(); //$map->loadBase64JS(); $map->loadAPI(); $map->loadCoordinatesJS(); // Map Box if ($this->t['border'] == '') { echo '
'; if ($this->t['fullwidth'] == 1) { echo '
'; } else { echo '
'; } echo '
'; } else { //echo '
t['stylesitewidth'].'>
'; echo '
'; if ($this->t['fullwidth'] == 1) { echo '
'; } else { echo '
'; } echo '
'; echo '
'; //echo '
'; } // Direction /* if ($this->t['displaydir']) { $countMarker = count($this->marker); $form = ''; if ((int)$countMarker > 1) { $form .= ' ' . Text::_('COM_PHOCAMAPS_TO').': '; } else if ((int)$countMarker == 1) { foreach ($this->marker as $key => $markerV) { if ((isset($markerV->longitude) && $markerV->longitude != '') && (isset($markerV->latitude) && $markerV->latitude != '')) { $form .= ''; } } } if ($form != '') { echo '
'; echo '
'; echo Text::_('COM_PHOCAMAPS_FROM_ADDRESS').': '; echo $form; echo ' '; echo '
'; echo '
'; if ($this->t['display_print_route'] == 1) { echo ''; } echo '
'; } } */ // $id is not used anymore as this is added in methods of Phoca Maps Class // e.g. 'phocaMap' will be not 'phocaMap'.$id as the id will be set in methods /* echo $map->startJScData(); echo $map->addAjaxAPI('maps', '3', $this->t['params']); echo $map->addAjaxAPI('search', '1', $this->t['paramssearch']); echo $map->createMap('phocaMap', 'mapPhocaMap', 'phocaLatLng', 'phocaOptions','tstPhocaMap', 'tstIntPhocaMap', FALSE, FALSE, $this->t['displaydir']); echo $map->cancelEventFunction(); echo $map->checkMapFunction(); echo $map->startMapFunction(); echo $map->setLatLng( $this->map->latitude, $this->map->longitude ); echo $map->startMapOptions(); echo $map->setMapOption('zoom', $this->map->zoom).','."\n"; echo $map->setCenterOpt().','."\n"; echo $map->setTypeControlOpt($this->map->typecontrol, $this->map->typecontrolposition).','."\n"; echo $map->setNavigationControlOpt($this->map->zoomcontrol).','."\n"; echo $map->setMapOption('scaleControl', $this->map->scalecontrol, TRUE ).','."\n"; echo $map->setMapOption('scrollwheel', $this->map->scrollwheelzoom, TRUE).','."\n"; echo $map->setMapOption('disableDoubleClickZoom', $this->map->disabledoubleclickzoom).','."\n"; // echo $map->setMapOption('googleBar', $this->map->googlebar).','."\n";// Not ready yet // echo $map->setMapOption('continuousZoom', $this->map->continuouszoom).','."\n";// Not ready yet echo $map->setMapOption('styles', $this->map->map_styles).','."\n"; echo $map->setMapTypeOpt($this->map->typeid)."\n"; echo $map->endMapOptions($this->map->custom_options); if ($this->t['close_opened_window'] == 1) { echo $map->setCloseOpenedWindow(); } echo $map->setMap();*/ $map->createMap($this->map->latitude, $this->map->longitude, $this->map->zoom); $map->setMapType(); // Markers jimport('joomla.filter.output'); $i = 0; if (isset($this->marker) && !empty($this->marker)) { $iconArray = array(); // add information about created icons to array and check it so no duplicity icons js code will be created foreach ($this->marker as $key => $markerV) { if ((isset($markerV->longitude) && $markerV->longitude != '') && (isset($markerV->latitude) && $markerV->latitude != '')) { if ($i == 0) { // Get info about first marker to use it in routing plan $firstMarker = $markerV; } //$hStyle = 'font-size:120%;margin: 5px 0px;font-weight:bold;'; //$text = '
' . addslashes($markerV->title) . '
'; $text = '
' . addslashes($markerV->title) . '
'; // Try to correct images in description $markerV->description = PhocaMapsHelper::fixImagePath($markerV->description); $markerV->description = str_replace('@', '@', $markerV->description); $text .= '
'. PhocaMapsHelper::strTrimAll(addslashes($markerV->description)).'
'; if ($markerV->displaygps == 1) { $text .= '
' .'' .'' .'
'. Text::_('COM_PHOCAMAPS_GPS') . ': '.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslatitude)).'
'.PhocaMapsHelper::strTrimAll(addslashes($markerV->gpslongitude)).'
'; } if(empty($markerV->icon)) { $markerV->icon = 0; } if(empty($markerV->title)){ $markerV->title = ''; } if(empty($markerV->description)){ $markerV->description = ''; } /*$iconOutput = $map->setMarkerIcon($markerV->icon, $markerV->iconext, $markerV->iurl, $markerV->iobject, $markerV->iurls, $markerV->iobjects, $markerV->iobjectshape); echo $map->outputMarkerJs($iconOutput['js'], $markerV->icon, $markerV->iconext); echo $map->setMarker($markerV->id,$markerV->title,$markerV->description,$markerV->latitude, $markerV->longitude, $iconOutput['icon'], $iconOutput['iconid'], $text, $markerV->contentwidth, $markerV->contentheight, $markerV->markerwindow, $iconOutput['iconshadow'], $iconOutput['iconshape'], $this->t['close_opened_window'] );*/ $map->setMarker($id . 'm'.$markerV->id, $markerV->title, $markerV->description, $markerV->latitude, $markerV->longitude, $text, $markerV->contentwidth, $markerV->contentheight, $markerV->markerwindow, $this->t['close_opened_window']); $markerIconOptions = array(); if (isset($markerV->osm_icon) && $markerV->osm_icon != '') { $markerIconOptions = $map->setMarkerIcon($id . 'm'.$markerV->id, $markerV->osm_icon, $markerV->osm_marker_color, $markerV->osm_icon_color, $markerV->osm_icon_prefix, $markerV->osm_icon_spin, $markerV->osm_icon_class); } if ($i == 0) { // Get info about first marker to use it in routing plan // so we get the same icons for markers in Options like the first marker has $firstMarker->markericonoptions = $markerIconOptions; } $i++; } } $map->setMarkerClusterer(); } /*if ($this->t['load_kml']) { echo $map->setKMLFile($this->t['load_kml']); } if ($this->t['displaydir']) { echo $map->setDirectionDisplayService('phocaDir'); } if(isset($this->map->scrollwheelzoom) && $this->map->scrollwheelzoom != 0){ echo $map->setListener(); } echo $map->endMapFunction(); if ($this->t['displaydir']) { echo $map->setDirectionFunction($this->t['display_print_route'], $this->map->id, $this->map->alias, $this->t['lang']); } echo $map->setInitializeFunctionSpecificMap(); echo $map->setInitializeFunction(); echo $map->endJScData(); echo $map->loadAPI();// must be loaded as last*/ $map->renderFullScreenControl(); $map->renderCurrentPosition(); $map->renderSearch('', 'topleft'); // Get Lat and Lng TO (first marker) $lat = $lng = 0; $mId = ''; $markerIconOptions = array(); if (isset($firstMarker->latitude)) { $lat = $firstMarker->latitude; } if (isset($firstMarker->longitude)) { $lng = $firstMarker->longitude; } if (isset($firstMarker->id)) { $mId = $id . 'm'.$firstMarker->id; } if (isset($firstMarker->markericonoptions)) { $markerIconOptions = $firstMarker->markericonoptions; } if (!empty($this->t['tracks'])) { foreach ($this->t['tracks'] as $ky=>$trk) { $fitbounds = $ky==0 ? $this->t['fitbounds'] : false; if (isset($trk['file'])) { $map->renderTrack($trk['file'], $trk['color'], $fitbounds); } } } $map->renderRouting(0,0,$lat,$lng, $mId, $markerIconOptions, $this->map->lang); $map->renderEasyPrint(); $map->renderMap(); } echo $foutput; echo '
'; ?>