0, 'longitude' => -3.709, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 1), array('id_tgis_data' => 1, 'longitude' => -3.710, 'latitude' => 40.420, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 2, 'longitude' => -3.711, 'latitude' => 40.420, 'altitude' => 0, 'manual_placemen' => 1), array('id_tgis_data' => 3, 'longitude' => -3.712, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 4, 'longitude' => -3.708187, 'latitude' => 40.42056, 'altitude' => 0, 'manual_placemen' => 0) ); } if ($idAgent == 2) { $listPoints = array( array('id_tgis_data' => 0, 'longitude' => -3.703, 'latitude' => 40.420, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 0, 'longitude' => -3.704, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 0, 'longitude' => -3.706, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 0) ); } if ($idAgent == 3) { $listPoints = array( array('id_tgis_data' => 0, 'longitude' => -3.701, 'latitude' => 40.425, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 0, 'longitude' => -3.703, 'latitude' => 40.422, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 0, 'longitude' => -3.708, 'latitude' => 40.424, 'altitude' => 0, 'manual_placemen' => 0), array('id_tgis_data' => 0, 'longitude' => -3.705, 'latitude' => 40.421, 'altitude' => 0, 'manual_placemen' => 0) ); } $avaliableColors = array("#ff0000", "#00ff00", "#0000ff", "#000000"); $randomIndex = array_rand($avaliableColors); $color = $avaliableColors[$randomIndex]; ?> 'controls', 'content' => array('Navigation', 'PanZoomBar', 'ScaleLine') ); //BY DEFAULT TODO need code and change db $idMap = process_sql_insert('tgis_map', array( 'map_name' => $conf['name'], 'initial_longitude' => $articaLongitude, 'initial_latitude' => $articaLatitude, 'initial_altitude' => $articaAltitude, 'zoom_level' => $conf['initial_zoom'], 'group_id' => $conf['group'] ) ); $zoom = array("type" => "numLevelsZoom","content" => $conf['numLevelsZoom']); process_sql_insert('tgis_map_connection', array( 'conection_data' => json_encode($defaultControl), 'tgis_map_id_tgis_map' => $idMap ) ); process_sql_insert('tgis_map_connection', array( 'conection_data' => json_encode($zoom), 'tgis_map_id_tgis_map' => $idMap ) ); foreach ($baselayers as $baselayer) { switch ($baselayer['type']) { case 'osm': $temp = array( 'type' => 'baselayer', 'content' => array( 'typeBaseLayer' => 'OSM', 'url' => $baselayer['url'] //, //'default' => $baselayer['default'] ) ); process_sql_insert('tgis_map_connection', array( 'conection_data' => json_encode($temp), 'tgis_map_id_tgis_map' => $idMap ) ); break; } } foreach($layers as $layer) { process_sql_insert('tgis_map_layer', array( 'layer_name' => $layer['name'], 'view_layer' => $layer['visible'], 'tgis_map_id_tgis_map' => $idMap, 'tgrupo_id_grupo' => $layer['group'] ) ); } return $return; } ?>