Setting the selection in the map to a specified polygon in a layer

3 messages Options
Embed this post
Permalink
Ari Þórðarson

Setting the selection in the map to a specified polygon in a layer

Reply Threaded More More options
Print post
Permalink
Some javascript/style in this post has been disabled (why?)

Hi everyone

 

I have a map of a town with many houses wich are all in one layer and each house has an id and I want to set the selection to one house with a specified id.  I thought that I could maby use the "setSelection" function in Map.js that is like this:

 

setSelection: function(selText, zoomTo)

 

Does anyone know in what kind of format the selText parameter for the setSelection function is suposed to be in.

It would be nice if I could se an example string that is passed to the function.

 

Greetings, Ari


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Mike Adair

Re: Setting the selection in the map to a specified polygon in a layer

Reply Threaded More More options
Print post
Permalink
Ari,

I can't recall where I got this from but this is an example I have used
for testing:

  var xml = '<?xml version="1.0" encoding="UTF-8"?>';
  xml += '<FeatureSet
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:noNamespaceSchemaLocation="FeatureSet-1.0.0.xsd">';
  xml += '<Layer id="'+layer.uniqueId+'">';
  xml += '<Class id="SHP_Schema:Parcels"><ID>MSYAAA==</ID></Class>';
  xml += '</Layer></FeatureSet>';

In this case the <Class> element is for the Sheboygan dataset.

Mike

Ari Þórðarson wrote:

>
> Hi everyone
>
>  
>
> I have a map of a town with many houses wich are all in one layer and
> each house has an id and I want to set the selection to one house with
> a specified id.  I thought that I could maby use the "setSelection"
> function in Map.js that is like this:
>
>  
>
> setSelection: function(selText, zoomTo)
>
>  
>
> Does anyone know in what kind of format the selText parameter for the
> setSelection function is suposed to be in.
>
> It would be nice if I could se an example string that is passed to the
> function.
>
>  
>
> Greetings, Ari
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> fusion-users mailing list
> [hidden email]
> http://lists.osgeo.org/mailman/listinfo/fusion-users
>  

--
   Michael Adair
   Senior Software Architect
   DM Solutions Group Inc.

   Office: (613) 565-5056 x26
   [hidden email]
   http://www.dmsolutions.ca
   http://research.dmsolutions.ca


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users
Chris Claydon

RE: Setting the selection in the map to a specified polygon in a layer

Reply Threaded More More options
Print post
Permalink
In reply to this post by Ari Þórðarson
Some javascript/style in this post has been disabled (why?)

If you are writing a script against the MapGuide Web Tier API, you can create an MgSelection object and then call it’s method ToXml() in order to obtain a selection string.

 

Chris.

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Ari Þórðarson
Sent: Wednesday, January 14, 2009 8:58 AM
To: [hidden email]
Subject: [fusion-users] Setting the selection in the map to a specified polygon in a layer

 

Hi everyone

 

I have a map of a town with many houses wich are all in one layer and each house has an id and I want to set the selection to one house with a specified id.  I thought that I could maby use the "setSelection" function in Map.js that is like this:

 

setSelection: function(selText, zoomTo)

 

Does anyone know in what kind of format the selText parameter for the setSelection function is suposed to be in.

It would be nice if I could se an example string that is passed to the function.

 

Greetings, Ari


_______________________________________________
fusion-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/fusion-users