[mapguide-users] ClearCache on Tile Base (Ajax viewer)...why it not work? look on code.

Maciej Skorczewski maciej.skorczewski at procad.pl
Wed Feb 7 05:56:13 EST 2007


Hi all!

Problem:

I try reload layer , after add new object to data source of this layer.
Data source is a PostGIS DataBase (user draw shape in ajax viewer   ex. 
polygont, after that , object is add to database - spatial sql insert - )

...but after that i wont to reload layer... in bootom is my PHP code of 
CLEAR CACHE (i use Tile Base Layer in Ajax viewer)


pleas take a lot on this - what is wrong whit that?

ps. after add object when i use -zoom in- the new object is there,  but 
when i go back (zoom out) it disappear again.

code are executet in taskPane.

----- code begin  -----


//initialize
MgInitializeWebTier($CONFIG_FILE);	
//session id get from SESSION who start when user enter on index.php
$mgSessionId =  $_SESSION['mgSessionId'];
$userInfo = new MgUserInformation($mgSessionId);
$siteConnection = new MgSiteConnection();
$siteConnection->Open($userInfo);
	
$resourceService = 
$siteConnection->CreateService(MgServiceType::ResourceService);


$tileService= $siteConnection->CreateService(MgServiceType::TileService );
	
$resourceID = new 
MgResourceIdentifier('Library://rysowanie/mapa_spatial.MapDefinition');
$map = new MgMap();
$map->Create($resourceService, $resourceID, 'mapa_spatial');
$tileService->ClearCache($map);
	
$sessionIdName = "Session:$mgSessionId//mapa_spatial.Map";
$sessionResourceID = new MgResourceIdentifier($sessionIdName);
$sessionResourceID->Validate();
$map->Save($resourceService, $sessionResourceID);
$mapUpdated = true;


------- code end -----



maciek


More information about the mapguide-users mailing list