$shape->properties = json_encode($tempProp); $shapes[$key] = $shape; $properties[] = $shape->properties; $type[] = $shape->geometry->type; $coordinates[] = json_encode($shape->geometry->coordinates) == "" ? "[]" : json_encode($shape->geometry->coordinates); $shapeCustomProperties[] = json_encode($customProperties[$key]) == "" ? "{}" : json_encode($customProperties[$key]); $styles[] = json_encode($shapeStyles[$key]) == "" ? "{}" : json_encode($shapeStyles[$key]); } updateMap((int) $_POST['id'], $user['id'], 'mapcenter', $_POST['mapcenter']); updateMap((int) $_POST['id'], $user['id'], 'zoom', (int) $_POST['zoom']); updateMap((int) $_POST['id'], $user['id'], 'overlay_title', $_POST['overlay_title']); updateMap((int) $_POST['id'], $user['id'], 'overlay_blurb', $_POST['overlay_blurb']); updateMap((int) $_POST['id'], $user['id'], 'overlay_content', $_POST['overlay_content']); updateMap((int) $_POST['id'], $user['id'], 'legend_content', $_POST['legend_content']); updateMap((int) $_POST['id'], $user['id'], 'image_overlays', $_POST['image_overlays']); updateMap((int) $_POST['id'], $user['id'], 'gpx_tracks', $_POST['gpx_tracks']); updateMap((int) $_POST['id'], $user['id'], 'map_bounds', $_POST['map_bounds']); updateMap((int) $_POST['id'], $user['id'], 'static_sidebar_content', $_POST['static_sidebar_content']); if (updateShapes((int) $_POST['id'], $properties, $type, $coordinates, $styles, $shapeCustomProperties)) { $success = "Map Successfully Saved!"; } else { $error = "Invalid Map Data"; } } } else { $error = "Invalid Request"; } } $_SESSION['response']['map-edit']['error'] = $error; $_SESSION['response']['map-edit']['success'] = $success; redirect(BASEURL . "app/map-edit.php?id=" . $_POST['id']);
updateMap($mapId, $user['id'], 'show_svg', $showSvg); updateMap($mapId, $user['id'], 'show_search', $showSearch); updateMap($mapId, $user['id'], 'show_playback', $showPlayback); updateMap($mapId, $user['id'], 'show_static_sidebar', $showStaticSidebar); updateMap($mapId, $user['id'], 'static_sidebar_content', $staticSidebarContent); updateMap($mapId, $user['id'], 'layers_id', $map['layerId']); updateMap($mapId, $user['id'], 'groups_id', $map['groupId']); updateMap($mapId, $user['id'], 'projects_id', $map['projectId']); updateMap($mapId, $user['id'], 'image_overlays', json_encode($map['imageOverlays'])); $properties = array(); $type = array(); $coordinates = array(); $styles = array(); $shapeCustomProperties = array(); foreach ($map['markers'] as $marker) { $marker = (array) $marker; $marker['showGetDirection'] = $marker['showGetDirection'] ? 'true' : 'false'; $marker['showInfoBox'] = $marker['showInfoBox'] ? 'true' : 'false'; $marker['showLocationOnPopup'] = $marker['showLocationOnPopup'] ? 'true' : 'false'; $marker['hideLabel'] = $marker['hideLabel'] ? 'true' : 'false'; $properties[] = '[{"name":"Location","value":"' . $marker['location'] . '","defaultProperty":true},{"name":"Popu-Up Content","value":"' . $marker['description'] . '","defaultProperty":false}]'; $type[] = 'Point'; $coordinates[] = '[' . $marker['longitude'] . ',' . $marker['latitude'] . ']'; $styles[] = '{"icon":"' . $marker['markerStyle'] . '","prefix":"fa","markerColor":"' . $marker['markerColor'] . '"}'; $shapeCustomProperties[] = '{"get_direction":' . $marker['showGetDirection'] . ',"bootstrap_popup":' . $marker['showInfoBox'] . ',"show_address_on_popup":' . $marker['showLocationOnPopup'] . ',"hide_label":' . $marker['hideLabel'] . '}'; } updateShapes($mapId, $properties, $type, $coordinates, $styles, $shapeCustomProperties, $user['id']); $_RESPONSE['success'] = true; $_RESPONSE['message'] = array('id' => $mapId, 'view' => BASEURL . "app/map-view.php?mapid=" . $mapId, 'download' => BASEURL . "app/map-download-html.php?mapid=" . $mapId, 'iframe' => "<iframe src='" . BASEURL . "app/map-view.php?mapid=" . $mapId . "' allowfullscreen='yes' height='" . $height . "' width='" . $width . "' scrolling='no' style='border:none'></iframe>"); } echo json_encode($_RESPONSE);
if (!$mapId) { $error = "Map is not created!"; } else { updateMap($mapId, $userId, 'source', 'website'); $properties = array(); $type = array(); $coordinates = array(); $styles = array(); $customproperties = array(); foreach ($validRows as $row) { $shape = prepareShapeData($row); $type[] = $shape['type']; $coordinates[] = $shape['coordinates']; $properties[] = $shape['properties']; $styles[] = $shape['styles']; $customproperties[] = $shape['customproperties']; } updateMap($mapId, $userId, 'stylingcolumn', $_POST['stylingColumn']); updateMap($mapId, $userId, 'shapestyling', $_POST['shapeStyling']); updateMap($mapId, $userId, 'name', $_POST['map-name']); updateMap($mapId, $userId, 'height', (int) $_POST['map-height']); updateMap($mapId, $userId, 'width', (int) $_POST['map-width']); updateMap($mapId, $userId, 'zoom', (int) $_POST['map-zoom']); updateMap($mapId, $userId, 'password', $_POST['map-password']); updateShapes($mapId, $properties, $type, $coordinates, $styles, $customproperties); $_SESSION['csv']['data'] = null; redirect(BASEURL . "app/csv-edit.php?id=" . $mapId); } } $_SESSION['response']['csv-create']['error'] = $error; redirect(BASEURL . "app/csv-create.php?action=");