[mapguide-users] programmatically add layer to initial map

Carl carl.grice at key-systems.com
Mon Aug 13 10:14:17 EDT 2007


The layer is a simple point layer from SQL Server using an OBDC connection 

I am not sure if this is related but I can successfully add the same
filtered layer to the same map no problem at all, if I perform the filter
and add layer in a second request. I.e. by adding a custom task 'add
filtered layer to map'. But I need a way to automatically add the filtered
layer when the map is initially displayed  

Hope that helps explain a little more.

Carl Grice
Keynetix Ltd
Tel. +44 (0) 1527 68888
Fax. +44 (0) 1527 62880
Web Site: http://www.keynetix.com

IMPORTANT: Please address all support & sales correspondence
keynetix at key-systems.com.
Addressing support questions to individuals may delay the response.

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org] On Behalf Of Scott, Brian
Sent: 13 August 2007 15:03
To: MapGuide Users Mail List
Subject: RE: [mapguide-users] programmatically add layer to initial map

Hi Carl - 

What db are you using?  I found, for example, that I could not filter at run
time against Postgres/PostGIS.  I was able to create a whole new layer based
on points available in PG, but I  had to extact the attributes, create
points, then apply them to a new layer.  Very cumbersome, but for whatever
reason, filtering just wouldn't work w/PostGIS.  

Good luck!
brian

-----Original Message-----
From: mapguide-users-bounces at lists.osgeo.org
[mailto:mapguide-users-bounces at lists.osgeo.org]On Behalf Of Carl Grice
Sent: Monday, August 13, 2007 10:01 AM
To: mapguide-users at lists.osgeo.org
Subject: [mapguide-users] programmatically add layer to initial map



Hi,

I am trying to programmatically filter and add a layer to a map that exists
in the repository before the map is initially loaded in the clients viewer.
The steps i am performing are as follows;

1)Initialize the web teir and open site
2)Create a new session and open a site connection
3)Use map.create() to create a map from an existing map definition in the
repository
4)Create a session resource identifier and use map.Save() to save the
existing map into the session repository
5)Use map.Open() to open the map resource just created in the session
repository
6)Use map.Getlayers() and insert() to add a new layer into the map
7)use map.save() to save the map with the added layer into the session
repository

When i debug my code i get no errors and the map displays in the viewer but
the added layer does not (even after performing a map refresh).

Please can you point me in the direction of a sample that performs a similar
task or provide a code example? (I have found similar problems disscussed
but cannot find a solution)

Thanks in advance.
-- 
View this message in context:
http://www.nabble.com/programmatically-add-layer-to-initial-map-tf4260888s16
610.html#a12125213
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users



 
 
****************************************************************************
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
****************************************************************************
********






 
 
****************************************************************************
********
This footnote confirms that this email message has been scanned by
PineApp Mail-SeCure for the presence of malicious code, vandals & computer
viruses.
****************************************************************************
********



_______________________________________________
mapguide-users mailing list
mapguide-users at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




More information about the mapguide-users mailing list