Re: [mapguide-users] select the location on map

2009-05-05 Thread Stefan Dalakov
// a basic filter and a spatial filter.
 
$queryOptions = new MgFeatureQueryOptions();
 
$queryOptions-SetSpatialFilter('panchayat',
$districtGeometry,
  MgFeatureSpatialOperations::Inside);
 
// Get the features from the feature source,
// turn it into a selection, then save the selection as
XML.
 
$layer = $map-GetLayers()-GetItem(0);
$featureReader = $layer-SelectFeatures($queryOptions);
 
$layer = $map-GetLayers()-GetItem(0);
$selection = new MgSelection($map);
$selection-AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection-ToXml();
 
 
  }
  catch (MgException $e)
  {
echo $e-GetMessage();
echo $e-GetDetails();
  }
  ?
 
/body
 
script language=javascript
 
 
  function OnPageLoad()
  {
selectionXml = '?php echo $selectionXml; ?';
parent.parent.SetSelectionXML(selectionXml);
  }
 
/script
 
  /body
  /html
 
  Can u find any error in this?
 
 
  regards
  susan
 
 
  On Tue, May 5, 2009 at 10:14 AM, Zac Spitzer
zac.spit...@gmail.com mailto:zac.spit...@gmail.com
  wrote:
 
  quicky n dirty but it should work
 
  input type=hidden name=SESSION id=mg_session value=/ 
  script
 document.getElementById('mg_session').value=Getsession();
  /script
 
 
  On Tue, May 5, 2009 at 2:39 PM, susan Daniel
daniel.sus...@gmail.com mailto:daniel.sus...@gmail.com
  wrote:
   hi chris
I removed that quotes .but the same error
occurred..Anyone
   know
   any
   other method to pass this SessionId mapname???
   help me pls
  
   regards
   susan
  
   On Mon, May 4, 2009 at 8:07 PM, Chris Claydon
   chris.clay...@autodesk.com
mailto:chris.clay...@autodesk.com
   wrote:
  
   It looks like this field input type=hiddenname=SESSION
   value=javascript:Getsession()/ 
   is using the string “javascript:Getsession()” rather than
actually
   calling
   the method and setting the value to the id that is returned.
  
  
  
   If you remove the quotes, what happens then?
  
  
  
   Chris.
  
  
  
   From: mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org
   [mailto:mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
   Daniel
   Sent: Sunday, May 03, 2009 10:09 PM
   To: MapGuide Users Mail List
   Subject: Re: [mapguide-users] select the location on map
  
  
  
   hi
  
 Still the same error 
  
   Invalid argument(s): [1] = javascript:Getsession() The
session ID
   is
   invalid because the session separator character was not
   found.Invalid
   argument(s): [1] = javascript:Getsession() The session
ID is
   invalid
   because the session separator character was not found.
Exception
   occurred in
   method MgUserInformation.SetMgSessionId at line 183 in file
   d:\buildforgeprojects\mapguide_open_source
  
  
   my code in window.php:
  
   body
   script language=javascripttype=javasript/text
  
   function Getsession()
   {
  
  
 document.myform.SESSION.value=parent.parent.mapframe.GetSessionId();
   }
   function Getmapname()
   {
  
 document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName() ;
   }
   /script
  
  
   form action=selectlocation.php method=get
   Enter PanId input type=text name=PanId/brbr
  
   input type=hiddenname=SESSION
value=javascript:Getsession()/
   
   input type=hiddenname=MAPNAME
value=javascript:Getmapname()/
   
   input type=submit value=Submit /
   /form
   brbr
  
  
   Tf anyone having any idea plsss help.I tried a lot
  
  
   thanksregards
   susan
  
  
  
  
   On Fri, Apr 24, 2009 at 4:24 PM, Stefan Dalakov
   s.dala...@mapware.net mailto:s.dala...@mapware.net
   wrote:
  
   You could use something like this (executed when
window.php is
   loaded)
  

document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName()

   ;
  
   Stefan
  
   susan Daniel wrote:
  
   hi..all
 Then what i have to do?Any solution to pass these
sessionId
   and
   mapname 
  
   regards
   susan
  
   On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov
   s.dala...@mapware.net mailto:s.dala

Re: [mapguide-users] select the location on map

2009-05-04 Thread Zac Spitzer
quicky n dirty but it should work

input type=hidden name=SESSION id=mg_session value=/ 
script
document.getElementById('mg_session').value=Getsession();
/script


On Tue, May 5, 2009 at 2:39 PM, susan Daniel daniel.sus...@gmail.com wrote:
 hi chris
  I removed that quotes .but the same error occurred..Anyone know any
 other method to pass this SessionId mapname???
 help me pls

 regards
 susan

 On Mon, May 4, 2009 at 8:07 PM, Chris Claydon chris.clay...@autodesk.com
 wrote:

 It looks like this field input type=hiddenname=SESSION
 value=javascript:Getsession()/ 
 is using the string “javascript:Getsession()” rather than actually calling
 the method and setting the value to the id that is returned.



 If you remove the quotes, what happens then?



 Chris.



 From: mapguide-users-boun...@lists.osgeo.org
 [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan Daniel
 Sent: Sunday, May 03, 2009 10:09 PM
 To: MapGuide Users Mail List
 Subject: Re: [mapguide-users] select the location on map



 hi

   Still the same error 

 Invalid argument(s): [1] = javascript:Getsession() The session ID is
 invalid because the session separator character was not found.Invalid
 argument(s): [1] = javascript:Getsession() The session ID is invalid
 because the session separator character was not found. Exception occurred in
 method MgUserInformation.SetMgSessionId at line 183 in file
 d:\buildforgeprojects\mapguide_open_source


 my code in window.php:

 body
 script language=javascripttype=javasript/text

 function Getsession()
 {
  document.myform.SESSION.value=parent.parent.mapframe.GetSessionId();
 }
 function Getmapname()
 {
  document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName() ;
 }
 /script


 form action=selectlocation.php method=get
 Enter PanId input type=text name=PanId/brbr

 input type=hiddenname=SESSION value=javascript:Getsession()/ 
 input type=hiddenname=MAPNAME value=javascript:Getmapname()/  
 input type=submit value=Submit /
 /form
 brbr


 Tf anyone having any idea plsss help.I tried a lot


 thanksregards
 susan




 On Fri, Apr 24, 2009 at 4:24 PM, Stefan Dalakov s.dala...@mapware.net
 wrote:

 You could use something like this (executed when window.php is loaded)

   document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName() ;

 Stefan

 susan Daniel wrote:

 hi..all
       Then what i have to do?Any solution to pass these sessionId and
 mapname 

 regards
 susan

 On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov s.dala...@mapware.net
 mailto:s.dala...@mapware.net wrote:

    These javascript.functions never get executed. I checked now, I
    added some alerts  and they didn't show.

    susan Daniel wrote:

    HI..
            I removed that brace but still the error is there


    regards
    susan

    On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng

    jumpinjac...@gmail.com mailto:jumpinjac...@gmail.com wrote:


        I see an extra brace (the very first one) in the javascript
        block that could
        be messing everything up.

        - Jackie


        SusanDaniel wrote:
        
         hi all
                 In order to display a form in the task pane i've
        the following
         code
         in ../mapviewerphp/window.php
        
         body
         script language=javascript
         {
         function getsession()
         {
         sessionId=parent.parent.mapframe.GetSessionId();
         }
         function getmapname()
         {
         mapname=parent.parent.mapframe.GetMapName();
         }
         /script
        
        
         form action=selectlocation.php method=get
         Enter PanId input type=text name=PanId/brbr
        
         input type=hiddenname=SESSION
        value=javascript:getsession()/ 
         input type=hiddenname=MAPNAME
        value=javascript:getmapname()/  
         input type=submit value=Submit /
         /form
        
         *and in the selectlocation .php i am having
         *
          /head
           ?php $ID= $_GET['PanId'];
             ?.br /
        
           body class=AppFrame onLoad=OnPageLoad()
        
             h1 class=AppHeadingSelect features/h1
        
        
             ?php
             include '../common/common.php';
        
             $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST:
        $_GET;
             $sessionId = $args['SESSION'];
             $mapName = $args['MAPNAME'];
        
             try
             {
        
               // Initialize the Web Extensions and connect to the
        Server using
               // the Web Extensions session identifier stored in
        PHP session
         state.
        
               MgInitializeWebTier ($webconfigFilePath);
        
               $userInfo = new MgUserInformation($sessionId);
               $siteConnection = new MgSiteConnection();
               $siteConnection-Open($userInfo);
        
               $map = new MgMap

Re: [mapguide-users] select the location on map

2009-05-04 Thread Zac Spitzer
you changed the order!

what you have done is try to reference the hidden form field before it exists

z

On Tue, May 5, 2009 at 3:02 PM, susan Daniel daniel.sus...@gmail.com wrote:
 hi zac...

     It is also not working..

 This is the code


 body



 script
    document.getElementById('mg_session').value=Getsession();
 /script



 form action=selectlocation.php method=get
 Enter PanId input type=text name=PanId/brbr

 input type=hidden name=SESSION id=mg_session value=/ 

 input type=submit value=Submit /
 /form


 and in selectlocation.php i'm having this code:

 ?php $ID= $_GET['PanId'];

    ?br /

   body class=AppFrame onLoad=OnPageLoad()

     h1 class=AppHeadingSelect features/h1



     ?php
     include '../common/common.php';

     $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;

     $sessionId = $args['SESSION'];
     $mapName = $args['MAPNAME'];


     try
     {

   // Initialize the Web Extensions and connect to the Server using
   // the Web Extensions session identifier stored in PHP session state.

   MgInitializeWebTier ($webconfigFilePath);

   $userInfo = new MgUserInformation($sessionId  );
   $siteConnection = new MgSiteConnection();
   $siteConnection-Open($userInfo);

   $map = new MgMap($siteConnection);
   $map-Open( $mapName  );

   // Get the geometry for the boundaries of District 1

   $districtQuery = new MgFeatureQueryOptions();
   $districtQuery-SetFilter(pan_id==$ID);

   $layer = $map-GetLayers()-GetItem('Panchayat');
   $featureReader = $layer-SelectFeatures($districtQuery);
   $featureReader-ReadNext();
   $districtGeometryData = $featureReader-
   GetGeometry('Data');

   // Convert the AGF binary data to MgGeometry.

   $agfReaderWriter = new MgAgfReaderWriter();
   $districtGeometry = $agfReaderWriter-Read($districtGeometryData);

   // Create a filter to select the desired features. Combine
   // a basic filter and a spatial filter.

   $queryOptions = new MgFeatureQueryOptions();

   $queryOptions-SetSpatialFilter('panchayat', $districtGeometry,
 MgFeatureSpatialOperations::Inside);

   // Get the features from the feature source,
   // turn it into a selection, then save the selection as XML.

   $layer = $map-GetLayers()-GetItem(0);
   $featureReader = $layer-SelectFeatures($queryOptions);

   $layer = $map-GetLayers()-GetItem(0);
   $selection = new MgSelection($map);
   $selection-AddFeatures($layer, $featureReader, 0);
   $selectionXml = $selection-ToXml();


     }
     catch (MgException $e)
     {
   echo $e-GetMessage();
   echo $e-GetDetails();
     }
     ?

   /body

   script language=javascript


     function OnPageLoad()
     {
   selectionXml = '?php echo $selectionXml; ?';
   parent.parent.SetSelectionXML(selectionXml);
     }

   /script

 /body
 /html

 Can u find any error in this?


 regards
 susan


 On Tue, May 5, 2009 at 10:14 AM, Zac Spitzer zac.spit...@gmail.com wrote:

 quicky n dirty but it should work

 input type=hidden name=SESSION id=mg_session value=/ 
 script
        document.getElementById('mg_session').value=Getsession();
 /script


 On Tue, May 5, 2009 at 2:39 PM, susan Daniel daniel.sus...@gmail.com
 wrote:
  hi chris
   I removed that quotes .but the same error occurred..Anyone know
  any
  other method to pass this SessionId mapname???
  help me pls
 
  regards
  susan
 
  On Mon, May 4, 2009 at 8:07 PM, Chris Claydon
  chris.clay...@autodesk.com
  wrote:
 
  It looks like this field input type=hiddenname=SESSION
  value=javascript:Getsession()/ 
  is using the string “javascript:Getsession()” rather than actually
  calling
  the method and setting the value to the id that is returned.
 
 
 
  If you remove the quotes, what happens then?
 
 
 
  Chris.
 
 
 
  From: mapguide-users-boun...@lists.osgeo.org
  [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
  Daniel
  Sent: Sunday, May 03, 2009 10:09 PM
  To: MapGuide Users Mail List
  Subject: Re: [mapguide-users] select the location on map
 
 
 
  hi
 
    Still the same error 
 
  Invalid argument(s): [1] = javascript:Getsession() The session ID is
  invalid because the session separator character was not found.Invalid
  argument(s): [1] = javascript:Getsession() The session ID is invalid
  because the session separator character was not found. Exception
  occurred in
  method MgUserInformation.SetMgSessionId at line 183 in file
  d:\buildforgeprojects\mapguide_open_source
 
 
  my code in window.php:
 
  body
  script language=javascripttype=javasript/text
 
  function Getsession()
  {
   document.myform.SESSION.value=parent.parent.mapframe.GetSessionId();
  }
  function Getmapname()
  {
   document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName() ;
  }
  /script
 
 
  form action=selectlocation.php method=get
  Enter PanId input type=text name=PanId

Re: [mapguide-users] select the location on map

2009-05-04 Thread Zac Spitzer
=hiddenname=SESSION
   value=javascript:Getsession()/ 
   is using the string “javascript:Getsession()” rather than actually
   calling
   the method and setting the value to the id that is returned.
  
  
  
   If you remove the quotes, what happens then?
  
  
  
   Chris.
  
  
  
   From: mapguide-users-boun...@lists.osgeo.org
   [mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
   Daniel
   Sent: Sunday, May 03, 2009 10:09 PM
   To: MapGuide Users Mail List
   Subject: Re: [mapguide-users] select the location on map
  
  
  
   hi
  
     Still the same error 
  
   Invalid argument(s): [1] = javascript:Getsession() The session ID
   is
   invalid because the session separator character was not
   found.Invalid
   argument(s): [1] = javascript:Getsession() The session ID is
   invalid
   because the session separator character was not found. Exception
   occurred in
   method MgUserInformation.SetMgSessionId at line 183 in file
   d:\buildforgeprojects\mapguide_open_source
  
  
   my code in window.php:
  
   body
   script language=javascripttype=javasript/text
  
   function Getsession()
   {
  
    document.myform.SESSION.value=parent.parent.mapframe.GetSessionId();
   }
   function Getmapname()
   {
    document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName() ;
   }
   /script
  
  
   form action=selectlocation.php method=get
   Enter PanId input type=text name=PanId/brbr
  
   input type=hiddenname=SESSION value=javascript:Getsession()/
   
   input type=hiddenname=MAPNAME value=javascript:Getmapname()/
   
   input type=submit value=Submit /
   /form
   brbr
  
  
   Tf anyone having any idea plsss help.I tried a lot
  
  
   thanksregards
   susan
  
  
  
  
   On Fri, Apr 24, 2009 at 4:24 PM, Stefan Dalakov
   s.dala...@mapware.net
   wrote:
  
   You could use something like this (executed when window.php is
   loaded)
  
     document.myform.MAPNAME.value=parent.parent.mapFrame.GetMapName()
   ;
  
   Stefan
  
   susan Daniel wrote:
  
   hi..all
         Then what i have to do?Any solution to pass these sessionId
   and
   mapname 
  
   regards
   susan
  
   On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov
   s.dala...@mapware.net
   mailto:s.dala...@mapware.net wrote:
  
      These javascript.functions never get executed. I checked now, I
      added some alerts  and they didn't show.
  
      susan Daniel wrote:
  
      HI..
              I removed that brace but still the error is there
  
  
      regards
      susan
  
      On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng
  
      jumpinjac...@gmail.com mailto:jumpinjac...@gmail.com wrote:
  
  
          I see an extra brace (the very first one) in the javascript
          block that could
          be messing everything up.
  
          - Jackie
  
  
          SusanDaniel wrote:
          
           hi all
                   In order to display a form in the task pane i've
          the following
           code
           in ../mapviewerphp/window.php
          
           body
           script language=javascript
           {
           function getsession()
           {
           sessionId=parent.parent.mapframe.GetSessionId();
           }
           function getmapname()
           {
           mapname=parent.parent.mapframe.GetMapName();
           }
           /script
          
          
           form action=selectlocation.php method=get
           Enter PanId input type=text name=PanId/brbr
          
           input type=hiddenname=SESSION
          value=javascript:getsession()/ 
           input type=hiddenname=MAPNAME
          value=javascript:getmapname()/  
           input type=submit value=Submit /
           /form
          
           *and in the selectlocation .php i am having
           *
            /head
             ?php $ID= $_GET['PanId'];
               ?.br /
          
             body class=AppFrame onLoad=OnPageLoad()
          
               h1 class=AppHeadingSelect features/h1
          
          
               ?php
               include '../common/common.php';
          
               $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST:
          $_GET;
               $sessionId = $args['SESSION'];
               $mapName = $args['MAPNAME'];
          
               try
               {
          
                 // Initialize the Web Extensions and connect to the
          Server using
                 // the Web Extensions session identifier stored in
          PHP session
           state.
          
                 MgInitializeWebTier ($webconfigFilePath);
          
                 $userInfo = new MgUserInformation($sessionId);
                 $siteConnection = new MgSiteConnection();
                 $siteConnection-Open($userInfo);
          
                 $map = new MgMap($siteConnection);
                 $map-Open($mapName);
          
                 // Get the geometry for the boundaries of District 1

Re: [mapguide-users] select the location on map

2009-04-24 Thread susan Daniel
HI..
I removed that brace but still the error is there


regards
susan

On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng jumpinjac...@gmail.com wrote:


 I see an extra brace (the very first one) in the javascript block that
 could
 be messing everything up.

 - Jackie


 SusanDaniel wrote:
 
  hi all
  In order to display a form in the task pane i've the following
  code
  in ../mapviewerphp/window.php
 
  body
  script language=javascript
  {
  function getsession()
  {
  sessionId=parent.parent.mapframe.GetSessionId();
  }
  function getmapname()
  {
  mapname=parent.parent.mapframe.GetMapName();
  }
  /script
 
 
  form action=selectlocation.php method=get
  Enter PanId input type=text name=PanId/brbr
 
  input type=hiddenname=SESSION value=javascript:getsession()/ 
  input type=hiddenname=MAPNAME value=javascript:getmapname()/  
  input type=submit value=Submit /
  /form
 
  *and in the selectlocation .php i am having
  *
   /head
?php $ID= $_GET['PanId'];
  ?.br /
 
body class=AppFrame onLoad=OnPageLoad()
 
  h1 class=AppHeadingSelect features/h1
 
 
  ?php
  include '../common/common.php';
 
  $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
  $sessionId = $args['SESSION'];
  $mapName = $args['MAPNAME'];
 
  try
  {
 
// Initialize the Web Extensions and connect to the Server using
// the Web Extensions session identifier stored in PHP session
  state.
 
MgInitializeWebTier ($webconfigFilePath);
 
$userInfo = new MgUserInformation($sessionId);
$siteConnection = new MgSiteConnection();
$siteConnection-Open($userInfo);
 
$map = new MgMap($siteConnection);
$map-Open($mapName);
 
// Get the geometry for the boundaries of District 1
 
$districtQuery = new MgFeatureQueryOptions();
$districtQuery-SetFilter(pan_id==$ID);
 
$layer = $map-GetLayers()-GetItem('Panchayat');
$featureReader = $layer-SelectFeatures($districtQuery);
$featureReader-ReadNext();
$districtGeometryData = $featureReader-
GetGeometry('Data');
 
// Convert the AGF binary data to MgGeometry.
 
$agfReaderWriter = new MgAgfReaderWriter();
$districtGeometry = $agfReaderWriter-Read($districtGeometryData);
 
// Create a filter to select the desired features. Combine
// a basic filter and a spatial filter.
 
$queryOptions = new MgFeatureQueryOptions();
 
$queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
  MgFeatureSpatialOperations::Inside);
 
// Get the features from the feature source,
// turn it into a selection, then save the selection as XML.
 
$layer = $map-GetLayers()-GetItem(0);
$featureReader = $layer-SelectFeatures($queryOptions);
 
$layer = $map-GetLayers()-GetItem(0);
$selection = new MgSelection($map);
$selection-AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection-ToXml();
 
 
  }
  catch (MgException $e)
  {
echo $e-GetMessage();
echo $e-GetDetails();
  }
  ?
 
/body
 
script language=javascript
 
 
  function OnPageLoad()
  {
selectionXml = '?php echo $selectionXml; ?';
parent.parent.SetSelectionXML(selectionXml);
  }
 
/script
 
  /body
  /html
 
 
 
  *This code..But when i enter the panId in the form this error is occuring
  *
 
Invalid argument(s): [1] = javascript:getsession() The session ID is
  invalid because the session separator character was not found.Invalid
  argument(s): [1] = javascript:getsession() The session ID is invalid
  because the session separator character was not found. Exception occurred
  in
  method MgUserInformation.SetMgSessionId at line 183 in file
 
 d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\mapguidecommon\System/UserInformation.cpp
 
 
  Any mistake in my coding?
 
  Help me plss
 
  regards
  susan
 
  On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
  dave.wil...@autodesk.comwrote:
 
   Did you check out the samples in the downloads area of Osgeo?
 
 
 
  http://mapguide.osgeo.org/download/releases/2.0.x-samples
 
 
 
  Dave
 
 
 
  *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
  mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Ivan Milicevic
  *Sent:* Wednesday, April 22, 2009 1:52 AM
  *To:* MapGuide Users Mail List
  *Subject:* RE: [mapguide-users] select the location on map
 
 
 
  You can get it from some of them. Please, read descritption.
 
 
 
  *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
  mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *susan Daniel
  *Sent:* Wednesday, April 22, 2009 9:46 AM
  *To:* MapGuide Users Mail List
  *Subject:* Re: [mapguide-users] select the location on map
 
 
 
  Thank u
 Can i get the source code of any of these sample
  applications? If so from where

RE: [mapguide-users] select the location on map

2009-04-24 Thread Ivan Milicevic
Try this:

 

 script language=javascript
function getsession()
{
 var sessionId=parent.parent.mapframe.GetSessionId();
}
function getmapname()
{

 var mapname=parent.parent.mapframe.GetMapName();
}
/script

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 24, 2009 11:25 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

HI..
I removed that brace but still the error is there


regards
susan

On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng jumpinjac...@gmail.com
wrote:


I see an extra brace (the very first one) in the javascript block that
could
be messing everything up.

- Jackie



SusanDaniel wrote:

 hi all
 In order to display a form in the task pane i've the following
 code
 in ../mapviewerphp/window.php

 body
 script language=javascript
 {
 function getsession()
 {
 sessionId=parent.parent.mapframe.GetSessionId();
 }
 function getmapname()
 {
 mapname=parent.parent.mapframe.GetMapName();
 }
 /script


 form action=selectlocation.php method=get
 Enter PanId input type=text name=PanId/brbr

 input type=hiddenname=SESSION value=javascript:getsession()/ 
 input type=hiddenname=MAPNAME value=javascript:getmapname()/  
 input type=submit value=Submit /
 /form

 *and in the selectlocation .php i am having
 *
  /head
   ?php $ID= $_GET['PanId'];
 ?.br /

   body class=AppFrame onLoad=OnPageLoad()

 h1 class=AppHeadingSelect features/h1


 ?php
 include '../common/common.php';

 $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
 $sessionId = $args['SESSION'];
 $mapName = $args['MAPNAME'];

 try
 {

   // Initialize the Web Extensions and connect to the Server using
   // the Web Extensions session identifier stored in PHP session
 state.

   MgInitializeWebTier ($webconfigFilePath);

   $userInfo = new MgUserInformation($sessionId);
   $siteConnection = new MgSiteConnection();
   $siteConnection-Open($userInfo);

   $map = new MgMap($siteConnection);
   $map-Open($mapName);

   // Get the geometry for the boundaries of District 1

   $districtQuery = new MgFeatureQueryOptions();
   $districtQuery-SetFilter(pan_id==$ID);

   $layer = $map-GetLayers()-GetItem('Panchayat');
   $featureReader = $layer-SelectFeatures($districtQuery);
   $featureReader-ReadNext();
   $districtGeometryData = $featureReader-
   GetGeometry('Data');

   // Convert the AGF binary data to MgGeometry.

   $agfReaderWriter = new MgAgfReaderWriter();
   $districtGeometry =
$agfReaderWriter-Read($districtGeometryData);

   // Create a filter to select the desired features. Combine
   // a basic filter and a spatial filter.

   $queryOptions = new MgFeatureQueryOptions();

   $queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
 MgFeatureSpatialOperations::Inside);

   // Get the features from the feature source,
   // turn it into a selection, then save the selection as XML.

   $layer = $map-GetLayers()-GetItem(0);
   $featureReader = $layer-SelectFeatures($queryOptions);

   $layer = $map-GetLayers()-GetItem(0);
   $selection = new MgSelection($map);
   $selection-AddFeatures($layer, $featureReader, 0);
   $selectionXml = $selection-ToXml();


 }
 catch (MgException $e)
 {
   echo $e-GetMessage();
   echo $e-GetDetails();
 }
 ?

   /body

   script language=javascript


 function OnPageLoad()
 {
   selectionXml = '?php echo $selectionXml; ?';
   parent.parent.SetSelectionXML(selectionXml);
 }

   /script

 /body
 /html



 *This code..But when i enter the panId in the form this error is
occuring
 *

   Invalid argument(s): [1] = javascript:getsession() The session ID
is
 invalid because the session separator character was not found.Invalid
 argument(s): [1] = javascript:getsession() The session ID is invalid
 because the session separator character was not found. Exception
occurred
 in
 method MgUserInformation.SetMgSessionId at line 183 in file

d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common
\mapguidecommon\System/UserInformation.cpp


 Any mistake in my coding?

 Help me plss

 regards
 susan

 On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
 dave.wil...@autodesk.comwrote:

  Did you check out the samples in the downloads area of Osgeo?



 http://mapguide.osgeo.org/download/releases/2.0.x-samples



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Ivan Milicevic
 *Sent:* Wednesday, April 22, 2009 1:52 AM
 *To:* MapGuide Users Mail List
 *Subject:* RE: [mapguide-users] select the location on map



 You can get it from some of them. Please, read descritption.



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org

RE: [mapguide-users] select the location on map

2009-04-24 Thread Ivan Milicevic
Colud you put alert(mgSessionId) after you define it in javascript
function? What do you get in alert message?

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 24, 2009 12:15 PM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

hi..all
   Then what i have to do?Any solution to pass these sessionId and
mapname 

regards
susan

On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov s.dala...@mapware.net
wrote:

These javascript.functions never get executed. I checked now, I added
some alerts  and they didn't show.

susan Daniel wrote: 

HI..
I removed that brace but still the error is there


regards
susan

On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng jumpinjac...@gmail.com
wrote:


I see an extra brace (the very first one) in the javascript block that
could
be messing everything up.

- Jackie



SusanDaniel wrote:

 hi all
 In order to display a form in the task pane i've the following
 code
 in ../mapviewerphp/window.php

 body
 script language=javascript
 {
 function getsession()
 {
 sessionId=parent.parent.mapframe.GetSessionId();
 }
 function getmapname()
 {
 mapname=parent.parent.mapframe.GetMapName();
 }
 /script


 form action=selectlocation.php method=get
 Enter PanId input type=text name=PanId/brbr

 input type=hiddenname=SESSION value=javascript:getsession()/ 
 input type=hiddenname=MAPNAME value=javascript:getmapname()/  
 input type=submit value=Submit /
 /form

 *and in the selectlocation .php i am having
 *
  /head
   ?php $ID= $_GET['PanId'];
 ?.br /

   body class=AppFrame onLoad=OnPageLoad()

 h1 class=AppHeadingSelect features/h1


 ?php
 include '../common/common.php';

 $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
 $sessionId = $args['SESSION'];
 $mapName = $args['MAPNAME'];

 try
 {

   // Initialize the Web Extensions and connect to the Server using
   // the Web Extensions session identifier stored in PHP session
 state.

   MgInitializeWebTier ($webconfigFilePath);

   $userInfo = new MgUserInformation($sessionId);
   $siteConnection = new MgSiteConnection();
   $siteConnection-Open($userInfo);

   $map = new MgMap($siteConnection);
   $map-Open($mapName);

   // Get the geometry for the boundaries of District 1

   $districtQuery = new MgFeatureQueryOptions();
   $districtQuery-SetFilter(pan_id==$ID);

   $layer = $map-GetLayers()-GetItem('Panchayat');
   $featureReader = $layer-SelectFeatures($districtQuery);
   $featureReader-ReadNext();
   $districtGeometryData = $featureReader-
   GetGeometry('Data');

   // Convert the AGF binary data to MgGeometry.

   $agfReaderWriter = new MgAgfReaderWriter();
   $districtGeometry =
$agfReaderWriter-Read($districtGeometryData);

   // Create a filter to select the desired features. Combine
   // a basic filter and a spatial filter.

   $queryOptions = new MgFeatureQueryOptions();

   $queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
 MgFeatureSpatialOperations::Inside);

   // Get the features from the feature source,
   // turn it into a selection, then save the selection as XML.

   $layer = $map-GetLayers()-GetItem(0);
   $featureReader = $layer-SelectFeatures($queryOptions);

   $layer = $map-GetLayers()-GetItem(0);
   $selection = new MgSelection($map);
   $selection-AddFeatures($layer, $featureReader, 0);
   $selectionXml = $selection-ToXml();


 }
 catch (MgException $e)
 {
   echo $e-GetMessage();
   echo $e-GetDetails();
 }
 ?

   /body

   script language=javascript


 function OnPageLoad()
 {
   selectionXml = '?php echo $selectionXml; ?';
   parent.parent.SetSelectionXML(selectionXml);
 }

   /script

 /body
 /html



 *This code..But when i enter the panId in the form this error is
occuring
 *

   Invalid argument(s): [1] = javascript:getsession() The session ID
is
 invalid because the session separator character was not found.Invalid
 argument(s): [1] = javascript:getsession() The session ID is invalid
 because the session separator character was not found. Exception
occurred
 in
 method MgUserInformation.SetMgSessionId at line 183 in file

d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common
\mapguidecommon\System/UserInformation.cpp


 Any mistake in my coding?

 Help me plss

 regards
 susan

 On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
 dave.wil...@autodesk.comwrote:

  Did you check out the samples in the downloads area of Osgeo?



 http://mapguide.osgeo.org/download/releases/2.0.x-samples



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Ivan Milicevic
 *Sent:* Wednesday, April 22, 2009 1:52 AM
 *To:* MapGuide Users Mail List
 *Subject:* RE

Re: [mapguide-users] select the location on map

2009-04-24 Thread susan Daniel
hi...
  not getting the alert message.I don't know whether i did it in the
right way

regards
susan

On Fri, Apr 24, 2009 at 3:47 PM, Ivan Milicevic
ivan.milice...@supranet.hrwrote:

  Colud you put alert(mgSessionId) after you define it in javascript
 function? What do you get in alert message?



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *susan Daniel
 *Sent:* Friday, April 24, 2009 12:15 PM

 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 hi..all
Then what i have to do?Any solution to pass these sessionId and
 mapname 

 regards
 susan

 On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov s.dala...@mapware.net
 wrote:

 These javascript.functions never get executed. I checked now, I added some
 alerts  and they didn't show.

 susan Daniel wrote:

 HI..
 I removed that brace but still the error is there


 regards
 susan

 On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng jumpinjac...@gmail.com wrote:


 I see an extra brace (the very first one) in the javascript block that
 could
 be messing everything up.

 - Jackie



 SusanDaniel wrote:
 
  hi all
  In order to display a form in the task pane i've the following
  code
  in ../mapviewerphp/window.php
 
  body
  script language=javascript
  {
  function getsession()
  {
  sessionId=parent.parent.mapframe.GetSessionId();
  }
  function getmapname()
  {
  mapname=parent.parent.mapframe.GetMapName();
  }
  /script
 
 
  form action=selectlocation.php method=get
  Enter PanId input type=text name=PanId/brbr
 
  input type=hiddenname=SESSION value=javascript:getsession()/ 
  input type=hiddenname=MAPNAME value=javascript:getmapname()/  
  input type=submit value=Submit /
  /form
 
  *and in the selectlocation .php i am having
  *
   /head
?php $ID= $_GET['PanId'];
  ?.br /
 
body class=AppFrame onLoad=OnPageLoad()
 
  h1 class=AppHeadingSelect features/h1
 
 
  ?php
  include '../common/common.php';
 
  $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
  $sessionId = $args['SESSION'];
  $mapName = $args['MAPNAME'];
 
  try
  {
 
// Initialize the Web Extensions and connect to the Server using
// the Web Extensions session identifier stored in PHP session
  state.
 
MgInitializeWebTier ($webconfigFilePath);
 
$userInfo = new MgUserInformation($sessionId);
$siteConnection = new MgSiteConnection();
$siteConnection-Open($userInfo);
 
$map = new MgMap($siteConnection);
$map-Open($mapName);
 
// Get the geometry for the boundaries of District 1
 
$districtQuery = new MgFeatureQueryOptions();
$districtQuery-SetFilter(pan_id==$ID);
 
$layer = $map-GetLayers()-GetItem('Panchayat');
$featureReader = $layer-SelectFeatures($districtQuery);
$featureReader-ReadNext();
$districtGeometryData = $featureReader-
GetGeometry('Data');
 
// Convert the AGF binary data to MgGeometry.
 
$agfReaderWriter = new MgAgfReaderWriter();
$districtGeometry = $agfReaderWriter-Read($districtGeometryData);
 
// Create a filter to select the desired features. Combine
// a basic filter and a spatial filter.
 
$queryOptions = new MgFeatureQueryOptions();
 
$queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
  MgFeatureSpatialOperations::Inside);
 
// Get the features from the feature source,
// turn it into a selection, then save the selection as XML.
 
$layer = $map-GetLayers()-GetItem(0);
$featureReader = $layer-SelectFeatures($queryOptions);
 
$layer = $map-GetLayers()-GetItem(0);
$selection = new MgSelection($map);
$selection-AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection-ToXml();
 
 
  }
  catch (MgException $e)
  {
echo $e-GetMessage();
echo $e-GetDetails();
  }
  ?
 
/body
 
script language=javascript
 
 
  function OnPageLoad()
  {
selectionXml = '?php echo $selectionXml; ?';
parent.parent.SetSelectionXML(selectionXml);
  }
 
/script
 
  /body
  /html
 
 
 
  *This code..But when i enter the panId in the form this error is occuring
  *
 
Invalid argument(s): [1] = javascript:getsession() The session ID is
  invalid because the session separator character was not found.Invalid
  argument(s): [1] = javascript:getsession() The session ID is invalid
  because the session separator character was not found. Exception occurred
  in
  method MgUserInformation.SetMgSessionId at line 183 in file
 
 d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\mapguidecommon\System/UserInformation.cpp
 
 
  Any mistake in my coding?
 
  Help me plss
 
  regards
  susan
 
  On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
  dave.wil

Re: [mapguide-users] select the location on map

2009-04-24 Thread Stefan Dalakov



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*Ivan Milicevic
 *Sent:* Wednesday, April 22, 2009 1:52 AM
 *To:* MapGuide Users Mail List
 *Subject:* RE: [mapguide-users] select the location on map



 You can get it from some of them. Please, read descritption.



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
 *Sent:* Wednesday, April 22, 2009 9:46 AM
 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 Thank u
Can i get the source code of any of these sample
 applications? If so from where?

 regards
 susan

 On Wed, Apr 22, 2009 at 1:00 PM, Ivan Milicevic 
 ivan.milice...@supranet.hr mailto:ivan.milice...@supranet.hr
wrote:

 http://mapguide.osgeo.org/livegallery.html



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
 *Sent:* Wednesday, April 22, 2009 8:06 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 hi deve
I couldn't find that sample application.Any link?
 regards
 susan

 On Tue, Apr 21, 2009 at 8:01 PM, Dave Wilson
dave.wil...@autodesk.com mailto:dave.wil...@autodesk.com
 wrote:

 The sample application that does the Find Address does a
selection on the
 map when you click on one of the search results. I thought this was
 discussed in the Sample Application.



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
 *Sent:* Monday, April 20, 2009 12:18 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 hi alll...
   I read the dev guide but didn't get any idea
regarding
 this.Hav anyone tried this before pls give me any hint how to
start this
 ...

 thanks regards
 susan

 On Fri, Apr 17, 2009 at 8:18 PM, Dave Wilson
dave.wil...@autodesk.com mailto:dave.wil...@autodesk.com
 wrote:

 Have you read through the developer’s guide? It has sample code for
 selection and explains many concepts. It sounds like you need
to make
 either
 an invoke script or invoke url call from a command in your Basic or
 Flexible
 Web Layout. You don’t actually have to replace the
gettingstarted.php. In
 the invoke script or invoke url command allows you to specify
the target
 frame for the output of the script.



 Regards,

 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
 *Sent:* Friday, April 17, 2009 3:57 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 yeah...i know that..

 On Fri, Apr 17, 2009 at 3:15 PM, Ivan Milicevic 
 ivan.milice...@supranet.hr mailto:ivan.milice...@supranet.hr
wrote:

 Did you know how to create file that display's database table?
If you
 don't
 know that you must find help somewhere else because I'm not a
PHP guy.



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
 *Sent:* Friday, April 17, 2009 11:42 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 Hi..
 No i dont have the file that displays database
table...Actually iam
 doing this prjct in php.but i know javascript'

 On Fri, Apr 17, 2009 at 3:02 PM, Ivan Milicevic 
 ivan.milice...@supranet.hr mailto:ivan.milice...@supranet.hr
wrote:

 Ok, so you have file that display's data from your database
table? Or you
 don't have it at all? How familiar are you

Re: [mapguide-users] select the location on map

2009-04-24 Thread Stefan Dalakov
 i enter the panId in the form this
error is occuring
 *

   Invalid argument(s): [1] = javascript:getsession() The
session ID is
 invalid because the session separator character was not
found.Invalid
 argument(s): [1] = javascript:getsession() The session ID
is invalid
 because the session separator character was not found.
Exception occurred
 in
 method MgUserInformation.SetMgSessionId at line 183 in file


d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\mapguidecommon\System/UserInformation.cpp


 Any mistake in my coding?

 Help me plss

 regards
 susan

 On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
 dave.wil...@autodesk.com
mailto:dave.wil...@autodesk.comwrote:

  Did you check out the samples in the downloads area of Osgeo?



 http://mapguide.osgeo.org/download/releases/2.0.x-samples



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf
Of *Ivan Milicevic
 *Sent:* Wednesday, April 22, 2009 1:52 AM
 *To:* MapGuide Users Mail List
 *Subject:* RE: [mapguide-users] select the location on map



 You can get it from some of them. Please, read descritption.



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf
Of *susan Daniel
 *Sent:* Wednesday, April 22, 2009 9:46 AM
 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 Thank u
Can i get the source code of any of these
sample
 applications? If so from where?

 regards
 susan

 On Wed, Apr 22, 2009 at 1:00 PM, Ivan Milicevic 
 ivan.milice...@supranet.hr
mailto:ivan.milice...@supranet.hr wrote:

 http://mapguide.osgeo.org/livegallery.html



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf
Of *susan Daniel
 *Sent:* Wednesday, April 22, 2009 8:06 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 hi deve
I couldn't find that sample application.Any link?
 regards
 susan

 On Tue, Apr 21, 2009 at 8:01 PM, Dave Wilson
dave.wil...@autodesk.com mailto:dave.wil...@autodesk.com
 wrote:

 The sample application that does the Find Address does a
selection on the
 map when you click on one of the search results. I thought
this was
 discussed in the Sample Application.



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf
Of *susan Daniel
 *Sent:* Monday, April 20, 2009 12:18 AM


 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 hi alll...
   I read the dev guide but didn't get any
idea regarding
 this.Hav anyone tried this before pls give me any hint how
to start this
 ...

 thanks regards
 susan

 On Fri, Apr 17, 2009 at 8:18 PM, Dave Wilson
dave.wil...@autodesk.com mailto:dave.wil...@autodesk.com
 wrote:

 Have you read through the developer’s guide? It has sample
code for
 selection and explains many concepts. It sounds like you
need to make
 either
 an invoke script or invoke url call from a command in your
Basic or
 Flexible
 Web Layout. You don’t actually have to replace the
gettingstarted.php. In
 the invoke script or invoke url command allows you to
specify the target
 frame for the output of the script

Re: [mapguide-users] select the location on map

2009-04-24 Thread Jackie Ng

I see an extra brace (the very first one) in the javascript block that could
be messing everything up.

- Jackie


SusanDaniel wrote:
 
 hi all
 In order to display a form in the task pane i've the following
 code
 in ../mapviewerphp/window.php
 
 body
 script language=javascript
 {
 function getsession()
 {
 sessionId=parent.parent.mapframe.GetSessionId();
 }
 function getmapname()
 {
 mapname=parent.parent.mapframe.GetMapName();
 }
 /script
 
 
 form action=selectlocation.php method=get
 Enter PanId input type=text name=PanId/brbr
 
 input type=hiddenname=SESSION value=javascript:getsession()/ 
 input type=hiddenname=MAPNAME value=javascript:getmapname()/  
 input type=submit value=Submit /
 /form
 
 *and in the selectlocation .php i am having
 *
  /head
   ?php $ID= $_GET['PanId'];
 ?.br /
 
   body class=AppFrame onLoad=OnPageLoad()
 
 h1 class=AppHeadingSelect features/h1
 
 
 ?php
 include '../common/common.php';
 
 $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
 $sessionId = $args['SESSION'];
 $mapName = $args['MAPNAME'];
 
 try
 {
 
   // Initialize the Web Extensions and connect to the Server using
   // the Web Extensions session identifier stored in PHP session
 state.
 
   MgInitializeWebTier ($webconfigFilePath);
 
   $userInfo = new MgUserInformation($sessionId);
   $siteConnection = new MgSiteConnection();
   $siteConnection-Open($userInfo);
 
   $map = new MgMap($siteConnection);
   $map-Open($mapName);
 
   // Get the geometry for the boundaries of District 1
 
   $districtQuery = new MgFeatureQueryOptions();
   $districtQuery-SetFilter(pan_id==$ID);
 
   $layer = $map-GetLayers()-GetItem('Panchayat');
   $featureReader = $layer-SelectFeatures($districtQuery);
   $featureReader-ReadNext();
   $districtGeometryData = $featureReader-
   GetGeometry('Data');
 
   // Convert the AGF binary data to MgGeometry.
 
   $agfReaderWriter = new MgAgfReaderWriter();
   $districtGeometry = $agfReaderWriter-Read($districtGeometryData);
 
   // Create a filter to select the desired features. Combine
   // a basic filter and a spatial filter.
 
   $queryOptions = new MgFeatureQueryOptions();
 
   $queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
 MgFeatureSpatialOperations::Inside);
 
   // Get the features from the feature source,
   // turn it into a selection, then save the selection as XML.
 
   $layer = $map-GetLayers()-GetItem(0);
   $featureReader = $layer-SelectFeatures($queryOptions);
 
   $layer = $map-GetLayers()-GetItem(0);
   $selection = new MgSelection($map);
   $selection-AddFeatures($layer, $featureReader, 0);
   $selectionXml = $selection-ToXml();
 
 
 }
 catch (MgException $e)
 {
   echo $e-GetMessage();
   echo $e-GetDetails();
 }
 ?
 
   /body
 
   script language=javascript
 
 
 function OnPageLoad()
 {
   selectionXml = '?php echo $selectionXml; ?';
   parent.parent.SetSelectionXML(selectionXml);
 }
 
   /script
 
 /body
 /html
 
 
 
 *This code..But when i enter the panId in the form this error is occuring
 *
 
   Invalid argument(s): [1] = javascript:getsession() The session ID is
 invalid because the session separator character was not found.Invalid
 argument(s): [1] = javascript:getsession() The session ID is invalid
 because the session separator character was not found. Exception occurred
 in
 method MgUserInformation.SetMgSessionId at line 183 in file
 d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\mapguidecommon\System/UserInformation.cpp
 
 
 Any mistake in my coding?
 
 Help me plss
 
 regards
 susan
 
 On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
 dave.wil...@autodesk.comwrote:
 
  Did you check out the samples in the downloads area of Osgeo?



 http://mapguide.osgeo.org/download/releases/2.0.x-samples



 Dave



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Ivan Milicevic
 *Sent:* Wednesday, April 22, 2009 1:52 AM
 *To:* MapGuide Users Mail List
 *Subject:* RE: [mapguide-users] select the location on map



 You can get it from some of them. Please, read descritption.



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *susan Daniel
 *Sent:* Wednesday, April 22, 2009 9:46 AM
 *To:* MapGuide Users Mail List
 *Subject:* Re: [mapguide-users] select the location on map



 Thank u
Can i get the source code of any of these sample
 applications? If so from where?

 regards
 susan

 On Wed, Apr 22, 2009 at 1:00 PM, Ivan Milicevic 
 ivan.milice...@supranet.hr wrote:

 http://mapguide.osgeo.org/livegallery.html



 *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
 mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *susan Daniel
 *Sent:* Wednesday

Re: [mapguide-users] select the location on map

2009-04-24 Thread susan Daniel
hi..all
   Then what i have to do?Any solution to pass these sessionId and
mapname 

regards
susan

On Fri, Apr 24, 2009 at 3:24 PM, Stefan Dalakov s.dala...@mapware.netwrote:

  These javascript.functions never get executed. I checked now, I added some
 alerts  and they didn't show.

 susan Daniel wrote:

 HI..
 I removed that brace but still the error is there


 regards
 susan

 On Fri, Apr 24, 2009 at 2:35 PM, Jackie Ng jumpinjac...@gmail.com wrote:


 I see an extra brace (the very first one) in the javascript block that
 could
 be messing everything up.

 - Jackie


 SusanDaniel wrote:
 
  hi all
  In order to display a form in the task pane i've the following
  code
  in ../mapviewerphp/window.php
 
  body
  script language=javascript
  {
  function getsession()
  {
  sessionId=parent.parent.mapframe.GetSessionId();
  }
  function getmapname()
  {
  mapname=parent.parent.mapframe.GetMapName();
  }
  /script
 
 
  form action=selectlocation.php method=get
  Enter PanId input type=text name=PanId/brbr
 
  input type=hiddenname=SESSION value=javascript:getsession()/ 
  input type=hiddenname=MAPNAME value=javascript:getmapname()/  
  input type=submit value=Submit /
  /form
 
  *and in the selectlocation .php i am having
  *
   /head
?php $ID= $_GET['PanId'];
  ?.br /
 
body class=AppFrame onLoad=OnPageLoad()
 
  h1 class=AppHeadingSelect features/h1
 
 
  ?php
  include '../common/common.php';
 
  $args = ($_SERVER['REQUEST_METHOD'] == POST)? $_POST: $_GET;
  $sessionId = $args['SESSION'];
  $mapName = $args['MAPNAME'];
 
  try
  {
 
// Initialize the Web Extensions and connect to the Server using
// the Web Extensions session identifier stored in PHP session
  state.
 
MgInitializeWebTier ($webconfigFilePath);
 
$userInfo = new MgUserInformation($sessionId);
$siteConnection = new MgSiteConnection();
$siteConnection-Open($userInfo);
 
$map = new MgMap($siteConnection);
$map-Open($mapName);
 
// Get the geometry for the boundaries of District 1
 
$districtQuery = new MgFeatureQueryOptions();
$districtQuery-SetFilter(pan_id==$ID);
 
$layer = $map-GetLayers()-GetItem('Panchayat');
$featureReader = $layer-SelectFeatures($districtQuery);
$featureReader-ReadNext();
$districtGeometryData = $featureReader-
GetGeometry('Data');
 
// Convert the AGF binary data to MgGeometry.
 
$agfReaderWriter = new MgAgfReaderWriter();
$districtGeometry = $agfReaderWriter-Read($districtGeometryData);
 
// Create a filter to select the desired features. Combine
// a basic filter and a spatial filter.
 
$queryOptions = new MgFeatureQueryOptions();
 
$queryOptions-SetSpatialFilter('SHPGEOM', $districtGeometry,
  MgFeatureSpatialOperations::Inside);
 
// Get the features from the feature source,
// turn it into a selection, then save the selection as XML.
 
$layer = $map-GetLayers()-GetItem(0);
$featureReader = $layer-SelectFeatures($queryOptions);
 
$layer = $map-GetLayers()-GetItem(0);
$selection = new MgSelection($map);
$selection-AddFeatures($layer, $featureReader, 0);
$selectionXml = $selection-ToXml();
 
 
  }
  catch (MgException $e)
  {
echo $e-GetMessage();
echo $e-GetDetails();
  }
  ?
 
/body
 
script language=javascript
 
 
  function OnPageLoad()
  {
selectionXml = '?php echo $selectionXml; ?';
parent.parent.SetSelectionXML(selectionXml);
  }
 
/script
 
  /body
  /html
 
 
 
  *This code..But when i enter the panId in the form this error is
 occuring
  *
 
Invalid argument(s): [1] = javascript:getsession() The session ID
 is
  invalid because the session separator character was not found.Invalid
  argument(s): [1] = javascript:getsession() The session ID is invalid
  because the session separator character was not found. Exception
 occurred
  in
  method MgUserInformation.SetMgSessionId at line 183 in file
 
 d:\buildforgeprojects\mapguide_open_source_v2.0\build_27.16\mgdev\common\mapguidecommon\System/UserInformation.cpp
 
 
  Any mistake in my coding?
 
  Help me plss
 
  regards
  susan
 
  On Wed, Apr 22, 2009 at 9:01 PM, Dave Wilson
  dave.wil...@autodesk.comwrote:
 
   Did you check out the samples in the downloads area of Osgeo?
 
 
 
  http://mapguide.osgeo.org/download/releases/2.0.x-samples
 
 
 
  Dave
 
 
 
  *From:* mapguide-users-boun...@lists.osgeo.org [mailto:
  mapguide-users-boun...@lists.osgeo.org] *On Behalf Of *Ivan Milicevic
  *Sent:* Wednesday, April 22, 2009 1:52 AM
  *To:* MapGuide Users Mail List
  *Subject:* RE: [mapguide-users] select the location on map
 
 
 
  You can get it from some of them. Please, read descritption.
 
 
 
  *From:* mapguide-users-boun...@lists.osgeo.org [mailto

Re: [mapguide-users] select the location on map

2009-04-21 Thread Stefan Dalakov

Hi Susan,
After you have displayed some rows, and they are clickable, on clicking 
on a row you should (on the server side) create a selection object, add 
the feature corresponding to this row  to the selection object and  send 
the selection to  the viewer.  The code for this you can find in Dev 
Guide - there is a chapter named Setting the Active Selection With the 
Web API - page 53. I don't think I can explain it better, than the guys 
who wrote this document.


Stefan Dalakov

susan Daniel wrote:

hi  alll.
Nobody having any idea regarding thisUsing invokeUrl I 
connected the mapguide with mysql  database so that now the table can 
be display in the taskpane..Then what i am trying to do is...on 
clicking each record on the the table the corresponding polygon on the 
map should be selected??

 Can i do this ??I dont know how to proceed.
If any one having any idea pls help me..

Thanks in advance

susan


On Mon, Apr 20, 2009 at 11:48 AM, susan Daniel 
daniel.sus...@gmail.com mailto:daniel.sus...@gmail.com wrote:


hi alll...
  I read the dev guide but didn't get any idea
regarding this.Hav anyone tried this before pls give me any hint
how to start this ...

thanks regards
susan


On Fri, Apr 17, 2009 at 8:18 PM, Dave Wilson
dave.wil...@autodesk.com mailto:dave.wil...@autodesk.com wrote:

Have you read through the developer’s guide? It has sample
code for selection and explains many concepts. It sounds like
you need to make either an invoke script or invoke url call
from a command in your Basic or Flexible Web Layout. You don’t
actually have to replace the gettingstarted.php. In the invoke
script or invoke url command allows you to specify the target
frame for the output of the script.

 


Regards,

Dave

 


*From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
*Sent:* Friday, April 17, 2009 3:57 AM

*To:* MapGuide Users Mail List
*Subject:* Re: [mapguide-users] select the location on map

 


yeah...i know that..

On Fri, Apr 17, 2009 at 3:15 PM, Ivan Milicevic
ivan.milice...@supranet.hr
mailto:ivan.milice...@supranet.hr wrote:

Did you know how to create file that display's database table?
If you don't know that you must find help somewhere else
because I'm not a PHP guy.

 


*From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
*Sent:* Friday, April 17, 2009 11:42 AM


*To:* MapGuide Users Mail List
*Subject:* Re: [mapguide-users] select the location on map

 


Hi..
No i dont have the file that displays database
table...Actually iam doing this prjct in php.but i know
javascript'

On Fri, Apr 17, 2009 at 3:02 PM, Ivan Milicevic
ivan.milice...@supranet.hr
mailto:ivan.milice...@supranet.hr wrote:

Ok, so you have file that display's data from your database
table? Or you don't have it at all? How familiar are you with
javascript?

 


*From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org] *On Behalf Of
*susan Daniel
*Sent:* Friday, April 17, 2009 11:13 AM


*To:* MapGuide Users Mail List
*Subject:* Re: [mapguide-users] select the location on map

 


hi...
   My problem is that..
   I have a database table..Having colums  place ,id etc .If i
selected(clicking) a data in the table the corresponding
place(polygon) should be displayed(selected) on the map...My
map is a polygon map .each polygon having unique id.and the
same id is present in the db table alsoNow u got it?any
idea please help...

regards
susan

On Fri, Apr 17, 2009 at 2:24 PM, Ivan Milicevic
ivan.milice...@supranet.hr
mailto:ivan.milice...@supranet.hr wrote:

I'm not sure that I understand your problem. With this code
you can select any feature on map. Can you send a little bit
more information? I'm clues over there.

 


*From:* mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org
mailto:mapguide-users

RE: [mapguide-users] select the location on map

2009-04-17 Thread Ivan Milicevic
Hello Susan,

 

Here is C# code for selection, it's pretty same as PHP. 

 

MgSiteConnection siteConnection = null;

InitializeWebTier();

 

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

MgMap map = new MgMap();

map.Open(resourceService, 1); //opening map with name 1

 

MgFeatureQueryOptions queryOptionsObjekti = new
MgFeatureQueryOptions();

MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();

MgSelection selection = new MgSelection(map);

 

//Defining layer and feature source

MgLayer layerObjekti = GetLayerByName(map, OBJEKTI);

MgResourceIdentifier featureResIdObjekti = new
MgResourceIdentifier(Library://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);

 

//Creating feature filter, this is very important step!

string filter = ID= + idO;

 

queryOptionsObjekti.SetFilter(filter);

MgFeatureReader featureReaderObjekti =
featureService.SelectFeatures(featureResIdObjekti, OBJEKTI,
queryOptionsObjekti);

selection.AddFeatures(layerObjekti, featureReaderObjekti, 1);

selection.Save(resourceService, 1);

 

StringReader stream = new StringReader(selection.ToXml());

string selectionXml = selection.ToXml();

featureReaderObjekti.Close();

map.Save();

 

//Here, you call javascript function and pass the selection var

Response.Write(scriptselect(' + selectionXml + ');/script);

 

//This is javascript function that set's the selection from code and do
the refresh.

function select(xml)

{

parent.mapFrame.SetSelectionXML(xml);

parent.mapFrame.ExecuteMapAction(10);

}

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:11 AM
To: mapguide-users@lists.osgeo.org
Subject: [mapguide-users] select the location on map

 

hi all
My plat form is mapguide maestrophp.I connect it with mysql.Now
i want to select the corresponding polygon on the map while clicking on
the data in database.In order to display the database table in the
taskpane,i removed the contents of the file /mapviewerphp/getting
started .php and wrote my codings.then how to select the polygon?.Any
one know thisAnyone having coding to do this???
please help me

 
thanksregards
 susan

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


RE: [mapguide-users] select the location on map

2009-04-17 Thread Ivan Milicevic
OBJEKTI is layer name and other thing is path to the feature source.

 

Library://SAMPLES/DATA/SEWERS/SEWERS.FeatureSource);

 

You can copy/paste feature source from mapguide maestro in layer
definition window.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:45 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you Ivan
but  i 'd like to know on which file i want to write this coding??
In ur coding OBJEKT1  is layer name right?then what is
thisLibrary://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);
 
thanks and regards
susan

On Fri, Apr 17, 2009 at 12:46 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

Hello Susan,

 

Here is C# code for selection, it's pretty same as PHP. 

 

MgSiteConnection siteConnection = null;

InitializeWebTier();

 

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

MgMap map = new MgMap();

map.Open(resourceService, 1); //opening map with name 1

 

MgFeatureQueryOptions queryOptionsObjekti = new
MgFeatureQueryOptions();

MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();

MgSelection selection = new MgSelection(map);

 

//Defining layer and feature source

MgLayer layerObjekti = GetLayerByName(map, OBJEKTI);

MgResourceIdentifier featureResIdObjekti = new
MgResourceIdentifier(Library://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);

 

//Creating feature filter, this is very important step!

string filter = ID= + idO;

 

queryOptionsObjekti.SetFilter(filter);

MgFeatureReader featureReaderObjekti =
featureService.SelectFeatures(featureResIdObjekti, OBJEKTI,
queryOptionsObjekti);

selection.AddFeatures(layerObjekti, featureReaderObjekti, 1);

selection.Save(resourceService, 1);

 

StringReader stream = new StringReader(selection.ToXml());

string selectionXml = selection.ToXml();

featureReaderObjekti.Close();

map.Save();

 

//Here, you call javascript function and pass the selection var

Response.Write(scriptselect(' + selectionXml + ');/script);

 

//This is javascript function that set's the selection from code and do
the refresh.

function select(xml)

{

parent.mapFrame.SetSelectionXML(xml);

parent.mapFrame.ExecuteMapAction(10);

}

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:11 AM
To: mapguide-users@lists.osgeo.org
Subject: [mapguide-users] select the location on map

 

hi all
My plat form is mapguide maestrophp.I connect it with mysql.Now
i want to select the corresponding polygon on the map while clicking on
the data in database.In order to display the database table in the
taskpane,i removed the contents of the file /mapviewerphp/getting
started .php and wrote my codings.then how to select the polygon?.Any
one know thisAnyone having coding to do this???
please help me

 
thanksregards
 susan


___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




-- 
thanksregards
 susan

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users


RE: [mapguide-users] select the location on map

2009-04-17 Thread Ivan Milicevic
Ok, so you have file that display's data from your database table? Or
you don't have it at all? How familiar are you with javascript?

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 11:13 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

hi...
   My problem is that..
   I have a database table..Having colums  place ,id etc .If i
selected(clicking) a data in the table the corresponding place(polygon)
should be displayed(selected) on the map...My map is a polygon map .each
polygon having unique id.and the same id is present in the db table
alsoNow u got it?any idea please help...

regards
susan



On Fri, Apr 17, 2009 at 2:24 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

I'm not sure that I understand your problem. With this code you can
select any feature on map. Can you send a little bit more information?
I'm clues over there.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 10:47 AM


To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you  ivan...

   on which file i have to write this coding???  any
idea??

regards
susan

On Fri, Apr 17, 2009 at 2:09 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

OBJEKTI is layer name and other thing is path to the feature source.

 

Library://SAMPLES/DATA/SEWERS/SEWERS.FeatureSource);

 

You can copy/paste feature source from mapguide maestro in layer
definition window.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:45 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you Ivan
but  i 'd like to know on which file i want to write this coding??
In ur coding OBJEKT1  is layer name right?then what is
thisLibrary://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);
 
thanks and regards
susan

On Fri, Apr 17, 2009 at 12:46 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

Hello Susan,

 

Here is C# code for selection, it's pretty same as PHP. 

 

MgSiteConnection siteConnection = null;

InitializeWebTier();

 

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

MgMap map = new MgMap();

map.Open(resourceService, 1); //opening map with name 1

 

MgFeatureQueryOptions queryOptionsObjekti = new
MgFeatureQueryOptions();

MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();

MgSelection selection = new MgSelection(map);

 

//Defining layer and feature source

MgLayer layerObjekti = GetLayerByName(map, OBJEKTI);

MgResourceIdentifier featureResIdObjekti = new
MgResourceIdentifier(Library://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);

 

//Creating feature filter, this is very important step!

string filter = ID= + idO;

 

queryOptionsObjekti.SetFilter(filter);

MgFeatureReader featureReaderObjekti =
featureService.SelectFeatures(featureResIdObjekti, OBJEKTI,
queryOptionsObjekti);

selection.AddFeatures(layerObjekti, featureReaderObjekti, 1);

selection.Save(resourceService, 1);

 

StringReader stream = new StringReader(selection.ToXml());

string selectionXml = selection.ToXml();

featureReaderObjekti.Close();

map.Save();

 

//Here, you call javascript function and pass the selection var

Response.Write(scriptselect(' + selectionXml + ');/script);

 

//This is javascript function that set's the selection from code and do
the refresh.

function select(xml)

{

parent.mapFrame.SetSelectionXML(xml);

parent.mapFrame.ExecuteMapAction(10);

}

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:11 AM
To: mapguide-users@lists.osgeo.org
Subject: [mapguide-users] select the location on map

 

hi all
My plat form is mapguide maestrophp.I connect it with mysql.Now
i want to select the corresponding polygon on the map while clicking on
the data in database.In order to display the database table in the
taskpane,i removed the contents of the file /mapviewerphp/getting
started .php and wrote my codings.then how to select the polygon?.Any
one know thisAnyone having coding to do this???
please help me

 
thanksregards
 susan


___
mapguide-users mailing list
mapguide

RE: [mapguide-users] select the location on map

2009-04-17 Thread Ivan Milicevic
Did you know how to create file that display's database table? If you
don't know that you must find help somewhere else because I'm not a PHP
guy.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 11:42 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

Hi..
No i dont have the file that displays database table...Actually iam
doing this prjct in php.but i know javascript'



On Fri, Apr 17, 2009 at 3:02 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

Ok, so you have file that display's data from your database table? Or
you don't have it at all? How familiar are you with javascript?

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 11:13 AM


To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

hi...
   My problem is that..
   I have a database table..Having colums  place ,id etc .If i
selected(clicking) a data in the table the corresponding place(polygon)
should be displayed(selected) on the map...My map is a polygon map .each
polygon having unique id.and the same id is present in the db table
alsoNow u got it?any idea please help...

regards
susan

On Fri, Apr 17, 2009 at 2:24 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

I'm not sure that I understand your problem. With this code you can
select any feature on map. Can you send a little bit more information?
I'm clues over there.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 10:47 AM


To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you  ivan...

   on which file i have to write this coding???  any
idea??

regards
susan

On Fri, Apr 17, 2009 at 2:09 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

OBJEKTI is layer name and other thing is path to the feature source.

 

Library://SAMPLES/DATA/SEWERS/SEWERS.FeatureSource);

 

You can copy/paste feature source from mapguide maestro in layer
definition window.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:45 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you Ivan
but  i 'd like to know on which file i want to write this coding??
In ur coding OBJEKT1  is layer name right?then what is
thisLibrary://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);
 
thanks and regards
susan

On Fri, Apr 17, 2009 at 12:46 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

Hello Susan,

 

Here is C# code for selection, it's pretty same as PHP. 

 

MgSiteConnection siteConnection = null;

InitializeWebTier();

 

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

MgMap map = new MgMap();

map.Open(resourceService, 1); //opening map with name 1

 

MgFeatureQueryOptions queryOptionsObjekti = new
MgFeatureQueryOptions();

MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();

MgSelection selection = new MgSelection(map);

 

//Defining layer and feature source

MgLayer layerObjekti = GetLayerByName(map, OBJEKTI);

MgResourceIdentifier featureResIdObjekti = new
MgResourceIdentifier(Library://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);

 

//Creating feature filter, this is very important step!

string filter = ID= + idO;

 

queryOptionsObjekti.SetFilter(filter);

MgFeatureReader featureReaderObjekti =
featureService.SelectFeatures(featureResIdObjekti, OBJEKTI,
queryOptionsObjekti);

selection.AddFeatures(layerObjekti, featureReaderObjekti, 1);

selection.Save(resourceService, 1);

 

StringReader stream = new StringReader(selection.ToXml());

string selectionXml = selection.ToXml();

featureReaderObjekti.Close();

map.Save();

 

//Here, you call javascript function and pass the selection var

Response.Write(scriptselect(' + selectionXml + ');/script);

 

//This is javascript function that set's the selection from code and do
the refresh.

function select(xml)

{

parent.mapFrame.SetSelectionXML(xml);

parent.mapFrame.ExecuteMapAction(10);

}

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:11 AM
To: mapguide-users

RE: [mapguide-users] select the location on map

2009-04-17 Thread Ivan Milicevic
I'm not sure that I understand your problem. With this code you can
select any feature on map. Can you send a little bit more information?
I'm clues over there.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 10:47 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you  ivan...

   on which file i have to write this coding???  any
idea??

regards
susan

On Fri, Apr 17, 2009 at 2:09 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

OBJEKTI is layer name and other thing is path to the feature source.

 

Library://SAMPLES/DATA/SEWERS/SEWERS.FeatureSource);

 

You can copy/paste feature source from mapguide maestro in layer
definition window.

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:45 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] select the location on map

 

thank you Ivan
but  i 'd like to know on which file i want to write this coding??
In ur coding OBJEKT1  is layer name right?then what is
thisLibrary://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);
 
thanks and regards
susan

On Fri, Apr 17, 2009 at 12:46 PM, Ivan Milicevic
ivan.milice...@supranet.hr wrote:

Hello Susan,

 

Here is C# code for selection, it's pretty same as PHP. 

 

MgSiteConnection siteConnection = null;

InitializeWebTier();

 

MgUserInformation userInfo = new MgUserInformation(mgSessionId);

siteConnection = new MgSiteConnection();

siteConnection.Open(userInfo);

MgResourceService resourceService =
siteConnection.CreateService(MgServiceType.ResourceService) as
MgResourceService;

MgFeatureService featureService =
siteConnection.CreateService(MgServiceType.FeatureService) as
MgFeatureService;

MgMap map = new MgMap();

map.Open(resourceService, 1); //opening map with name 1

 

MgFeatureQueryOptions queryOptionsObjekti = new
MgFeatureQueryOptions();

MgAgfReaderWriter geometryReaderWriter = new MgAgfReaderWriter();

MgSelection selection = new MgSelection(map);

 

//Defining layer and feature source

MgLayer layerObjekti = GetLayerByName(map, OBJEKTI);

MgResourceIdentifier featureResIdObjekti = new
MgResourceIdentifier(Library://PROJEKTI/ + TIMgisUser +
/PODACI/OBJEKTI.FeatureSource);

 

//Creating feature filter, this is very important step!

string filter = ID= + idO;

 

queryOptionsObjekti.SetFilter(filter);

MgFeatureReader featureReaderObjekti =
featureService.SelectFeatures(featureResIdObjekti, OBJEKTI,
queryOptionsObjekti);

selection.AddFeatures(layerObjekti, featureReaderObjekti, 1);

selection.Save(resourceService, 1);

 

StringReader stream = new StringReader(selection.ToXml());

string selectionXml = selection.ToXml();

featureReaderObjekti.Close();

map.Save();

 

//Here, you call javascript function and pass the selection var

Response.Write(scriptselect(' + selectionXml + ');/script);

 

//This is javascript function that set's the selection from code and do
the refresh.

function select(xml)

{

parent.mapFrame.SetSelectionXML(xml);

parent.mapFrame.ExecuteMapAction(10);

}

 

 

From: mapguide-users-boun...@lists.osgeo.org
[mailto:mapguide-users-boun...@lists.osgeo.org] On Behalf Of susan
Daniel
Sent: Friday, April 17, 2009 9:11 AM
To: mapguide-users@lists.osgeo.org
Subject: [mapguide-users] select the location on map

 

hi all
My plat form is mapguide maestrophp.I connect it with mysql.Now
i want to select the corresponding polygon on the map while clicking on
the data in database.In order to display the database table in the
taskpane,i removed the contents of the file /mapviewerphp/getting
started .php and wrote my codings.then how to select the polygon?.Any
one know thisAnyone having coding to do this???
please help me

 
thanksregards
 susan


___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




-- 
thanksregards
 susan


___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users




-- 
thanksregards
 susan

___
mapguide-users mailing list
mapguide-users@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/mapguide-users