<?php include_once dirname(__FILE__) . "/config.php"; include_once dirname(__FILE__) . "/include/definitions.php"; if ($_POST["id"] && is_numeric($_POST["id"])) { $map = new Map(); $map->Load($_POST["id"]); if (!$map->IsGeocoded) { $map->AddGeocoding(); if ($map->IsGeocoded) { $map->Save(); Helper::WriteToLog("Added geocoding data to database for map with id " . $_POST["id"] . "."); print "1"; } else { Helper::WriteToLog("Failed to add geocoding data to database for map with id " . $_POST["id"] . ". Probably no QuickRoute jpeg file."); print "2"; } } else { print "3"; } }
global $platformDefaultConfig; $platformContext = new PlatformContext($platformDefaultConfig); $platformContext->RestoreSession(session_id()); $mapResource = new Resource($platformContext, substr($szMapFile, 10)); $sType = $mapResource->GetStoredType(); if (strtolower($sType) == "publishedmap") { $szPlatformMapfile = $mapResource->GetResourceContent("content")->get("content"); if (file_exists($szPlatformMapfile)) { $modifyPaths = true; $oMap = ms_newMapObj($szPlatformMapfile); $szMapFile = $szPlatformMapfile; } } else { $mapGen = new Map($platformContext, substr($szMapFile, 10)); if ($mapGen->Exists()) { $result = $mapGen->Save(); if ($result->IsOk()) { $sMapFileContents = $result->Get('MAPDATA'); } else { echo var2json($result); die; } $oMap = ms_newMapObjFromString($sMapFileContents); } } /* */ } else { if (file_exists($szMapFile)) { $modifyPaths = true; $oMap = ms_newMapObj($szMapFile);