Classes/Services/LayerContentService.php
private function getFileContent($objLayer, $folder, $fileInfo, $key, $count)
    {
        
        switch ($fileInfo['extension']) {
            case 'gpx':
                $child = array
                (
                    "id"        => strval($key.$count),
                    "pid"       => $key,
                    "name"      => utf8_encode($fileInfo['filename']),
                    "hide"      => $objLayer->published,
                    "display"   => true,
                    "type"      => $fileInfo['extension'],
                    "content" => array(),
                    "cssClass"  => $objLayer->cssClass,
                    "childs" => array()
                );
                
                $childLayerList = array
                (
                    "id" => strval($key.$count),
                    "type" => "urlData",
                    "format" => "GPX",
                    "origType" => "gpx",
                    "locationStyle" => $objLayer->locstyle,
                    "cluster_fillcolor" => $objLayer->cluster_fillcolor,
                    "cluster_fontcolor" => $objLayer->cluster_fontcolor,
                    "cluster_zoom" => $objLayer->cluster_zoom,
                    "cluster_popup" => $objLayer->cluster_popup,
                    "loc_linkurl" => Controller::replaceInsertTags($objLayer->loc_linkurl),
                    "hover_location" => $objLayer->hover_location,
                    "hover_style" => $objLayer->hover_style,
                    "data" => array
                    (
                        "popup" => array(
                            "content" => utf8_encode($fileInfo['filename']),//"tl_c4g_maps" . ":" . $objLayer->id . ":",
                            "async" => false
                        ),
                        "tooltip" => $objLayer->tooltip,
                        "tooltip_length" => $objLayer->tooltip_length,
                        "label" => $objLayer->loc_label,
                        'zoom_onclick' => $objLayer -> loc_onclick_zoomto,
                        "url" => utf8_encode($folder)."/".utf8_encode($fileInfo['basename']),
                    ),
                    "settings" => array
                    (
                        "loadAsync"     => false,
                        "refresh"       => false,
                        "crossOrigine"  => false,
                        "boundingBox"   => false,
                        "cluster"       => $objLayer->cluster_locations ? ($objLayer->cluster_distance ? $objLayer->cluster_distance : 20) : false,
                    )
                );
                $child['content'][] = $childLayerList;
                //        $childs[] = $child;
                return $child;
            case 'xml':
                return false;
            case 'geojson':
                return false;
            default:
                return false;
        }
        
        
    }
private function getFileContent($objLayer, $folder, $fileInfo, $key, $count)
    {
        
        switch ($fileInfo['extension']) {
            case 'gpx':
                $child = array
                (
                    "id"        => strval($key.$count),
                    "pid"       => $key,
                    "name"      => utf8_encode($fileInfo['filename']),
                    "hide"      => $objLayer->published,
                    "display"   => true,
                    "type"      => $fileInfo['extension'],
                    "content" => array(),
                    "cssClass"  => $objLayer->cssClass,
                    "childs" => array()
                );
                
                $childLayerList = array
                (
                    "id" => strval($key.$count),
                    "type" => "urlData",
                    "format" => "GPX",
                    "origType" => "gpx",
                    "locationStyle" => $objLayer->locstyle,
                    "cluster_fillcolor" => $objLayer->cluster_fillcolor,
                    "cluster_fontcolor" => $objLayer->cluster_fontcolor,
                    "cluster_zoom" => $objLayer->cluster_zoom,
                    "cluster_popup" => $objLayer->cluster_popup,
                    "loc_linkurl" => Controller::replaceInsertTags($objLayer->loc_linkurl),
                    "hover_location" => $objLayer->hover_location,
                    "hover_style" => $objLayer->hover_style,
                    "data" => array
                    (
                        "popup" => array(
                            "content" => utf8_encode($fileInfo['filename']),//"tl_c4g_maps" . ":" . $objLayer->id . ":",
                            "async" => false
                        ),
                        "tooltip" => $objLayer->tooltip,
                        "tooltip_length" => $objLayer->tooltip_length,
                        "label" => $objLayer->loc_label,
                        'zoom_onclick' => $objLayer -> loc_onclick_zoomto,
                        "url" => utf8_encode($folder)."/".utf8_encode($fileInfo['basename']),
                    ),
                    "settings" => array
                    (
                        "loadAsync"     => false,
                        "refresh"       => false,
                        "crossOrigine"  => false,
                        "boundingBox"   => false,
                        "cluster"       => $objLayer->cluster_locations ? ($objLayer->cluster_distance ? $objLayer->cluster_distance : 20) : false,
                    )
                );
                $child['content'][] = $childLayerList;
                //        $childs[] = $child;
                return $child;
            case 'xml':
                return false;
            case 'geojson':
                return false;
            default:
                return false;
        }
        
        
    }
private function getFileContent ( $ objLayer , $ folder , $ fileInfo , $ key , $ count ) { switch ( $ fileInfo [ 'extension' ] ) { case 'gpx' : $ child = array ( "id" => strval ( $ key . $ count ) , "pid" => $ key , "name" => utf8_encode ( $ fileInfo [ 'filename' ] ) , "hide" => $ objLayer -> published , "display" => true , "type" => $ fileInfo [ 'extension' ] , "content" => array ( ) , "cssClass" => $ objLayer -> cssClass , "childs" => array ( ) ) ; $ childLayerList = array ( "id" => strval ( $ key . $ count ) , "type" => "urlData" , "format" => "GPX" , "origType" => "gpx" , "locationStyle" => $ objLayer -> locstyle , "cluster_fillcolor" => $ objLayer -> cluster_fillcolor , "cluster_fontcolor" => $ objLayer -> cluster_fontcolor , "cluster_zoom" => $ objLayer -> cluster_zoom , "cluster_popup" => $ objLayer -> cluster_popup , "loc_linkurl" => Controller :: replaceInsertTags ( $ objLayer -> loc_linkurl ) , "hover_location" => $ objLayer -> hover_location , "hover_style" => $ objLayer -> hover_style , "data" => array ( "popup" => array ( "content" => utf8_encode ( $ fileInfo [ 'filename' ] ) , //"tl_c4g_maps" . ":" . $objLayer->id . ":", "async" => false ) , "tooltip" => $ objLayer -> tooltip , "tooltip_length" => $ objLayer -> tooltip_length , "label" => $ objLayer -> loc_label , 'zoom_onclick' => $ objLayer -> loc_onclick_zoomto , "url" => utf8_encode ( $ folder ) . "/" . utf8_encode ( $ fileInfo [ 'basename' ] ) , ) , "settings" => array ( "loadAsync" => false , "refresh" => false , "crossOrigine" => false , "boundingBox" => false , "cluster" => $ objLayer -> cluster_locations ? ( $ objLayer -> cluster_distance ? $ objLayer -> cluster_distance : 20 ) : false , ) ) ; $ child [ 'content' ] [ ] = $ childLayerList ; //        $childs[] = $child; return $ child ; case 'xml' : return false ; case 'geojson' : return false ; default : return false ; } }
Parses gpx contents of a given file for a given layer.
@param $objLayer
@param $folder
@param $fileInfo
@param $key
@param $count
@return array|bool
Parses gpx contents of a given file for a given layer .