Changing current selection colour

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

Changing current selection colour

Robert Leeman
Hi All:

Can anyone tell me how to change the current selection colour in the AJAX
viewer?  Thanks in advance.

Bob Leeman



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

RE: Changing current selection colour

Traian Stanev

The color (blue) is hardcoded in GDRenderer::SetRenderSelectionMode,
around line 1537 of GDRenderer.cpp, so you would have to recompile the
server.


Traian
 

-----Original Message-----
From: Robert Leeman [mailto:[hidden email]]
Sent: Sunday, July 16, 2006 7:17 PM
To: MapGuide Users List
Subject: [mapguide-users] Changing current selection colour

Hi All:

Can anyone tell me how to change the current selection colour in the
AJAX
viewer?  Thanks in advance.

Bob Leeman



---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]




---------------------------------------------------------------------
To unsubscribe, e-mail: [hidden email]
For additional commands, e-mail: [hidden email]

Reply | Threaded
Open this post in threaded view
|

Select and zoom to feature in Mapguide+Fusion

alba
hi Traian,

You excuse me for this email, but I see that you have sent many posts, then maybe you can help

I have the problem to select and to zoom objects on map

I use mgos 2.0.1 with IIS and fusion
I insert the function

<script language="javascript" > In my procedure I insert function GetParent() { if(popup) { return opener; } else { return parent.parent; } } ... function Selezione_oggetto(){ var resultSelect = document.getElementById("resultSelect"); var k=0; var valoreCercato=dati_ord[resultSelect.value]; while(valoreCercato!=dati[k]){ k=k+1; } //alert(k); reqParams = "COMMAND=GETSELECTIONXML"; reqParams += "&SESSION=" + encodeURIComponent(session); reqParams += "&MAPNAME=" + encodeURIComponent(mapName); reqParams += "&LAYERNAME=" + encodeURIComponent("Catastali"); reqParams += "&IDLIST=" + results[k].idList.toJSONString(); if (msie) reqHandler = new ActiveXObject("Microsoft.XMLHTTP"); else reqHandler = new XMLHttpRequest(); reqHandler.open("POST", "querycontroller.php", false); reqHandler.setRequestHeader("Content-Type", "application/x-www-form-urlencoded"); reqHandler.send(reqParams); selectionXml = reqHandler.responseText; alert(mapName); // ?????????? problem---------------------- //parent.parent.mapFrame.SetSelectionXML(TrimString(selectionXml));// old for mg 1.2 var map = GetParent().Fusion.getMapByName(mapName); // ?????????? map.SetSelectionXML(selectionXml);// ?????????? } function Zoom_oggetto() {//alert("ZoomToFeature"); var resultSelect = document.getElementById("resultSelect"); var scaleInput = document.getElementById("scaleInput"); scale = scaleInput.value; scale = (scale == 0) ? 10000 : scale; scale = scale*1.0; var k=0; var valoreCercato=dati_ord[resultSelect.value]; while(valoreCercato!=dati[k]){ k=k+1; } feature = results[k]; // ?????????? problem---------------------- //parent.parent.mapFrame.ZoomToView(feature.centerX, feature.centerY, scale, true);// ?????????? var map = GetParent().Fusion.getMapByName(mapName);// ?????????? map.ZoomToView(feature.centerX, feature.centerY, scale, true);// ?????????? } </script>
all from example ..www\phpviewersample\query

but it does not work!

Can you help me, please?

Thank Alba
Reply | Threaded
Open this post in threaded view
|

RE: Select and zoom to feature in Mapguide+Fusion

Chris Claydon
Hi Alba,

Do you get any errors displayed when you run this?

Does the alert popup correctly with your map name?

If you add an alert to display the selectionXml, does it look valid too?

The instructions below refer to the most recent version of Fusion, so I can't guarantee that they're valid for the one you're using...

I don't think the Fusion map object has a SetSelectionXML method. Instead, you would want to call map.setSelection(selectionXml, false). The second parameter controls whether or not you want to zoom to the extents of the selection.

There is also no ZoomToView method in the current version. Instead, you should call var extent = map.getExtentFromPoint(feature.centerX, feature.centerY, scale); and then map.setExtents(extent);

Let me know if this works with your version.

Chris.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of alba
Sent: Thursday, April 23, 2009 9:13 AM
To: [hidden email]
Subject: [mapguide-users] Select and zoom to feature in Mapguide+Fusion


hi Traian,

You excuse me for this email, but I see that you have sent many posts, then
maybe you can help

I have the problem to select and to zoom objects on map

I use mgos 2.0.1 with IIS and fusion
I insert the function

<script language="javascript" >

In my procedure I insert

function GetParent()
{
    if(popup) {
        return opener;
    } else {
        return parent.parent;
    }
}


...
function Selezione_oggetto(){

var resultSelect = document.getElementById("resultSelect");
var k=0;
var valoreCercato=dati_ord[resultSelect.value];
while(valoreCercato!=dati[k]){
  k=k+1;
  }
            //alert(k);
            reqParams = "COMMAND=GETSELECTIONXML";
                        reqParams += "&SESSION=" + encodeURIComponent(session);
            reqParams += "&MAPNAME=" + encodeURIComponent(mapName);
                        reqParams += "&LAYERNAME=" + encodeURIComponent("Catastali");
                        reqParams += "&IDLIST=" + results[k].idList.toJSONString();
            if (msie)
                reqHandler = new ActiveXObject("Microsoft.XMLHTTP");
            else
                reqHandler = new XMLHttpRequest();

            reqHandler.open("POST", "querycontroller.php", false);
            reqHandler.setRequestHeader("Content-Type",
"application/x-www-form-urlencoded");
                        reqHandler.send(reqParams);
                        selectionXml = reqHandler.responseText;
            alert(mapName);

// ?????????? problem----------------------

//parent.parent.mapFrame.SetSelectionXML(TrimString(selectionXml));// old
for mg 1.2

var map = GetParent().Fusion.getMapByName(mapName);  // ??????????

map.SetSelectionXML(selectionXml);// ??????????
}


function Zoom_oggetto()
{//alert("ZoomToFeature");
var resultSelect = document.getElementById("resultSelect");
var scaleInput = document.getElementById("scaleInput");
scale = scaleInput.value;
scale = (scale == 0) ? 10000 : scale;
scale = scale*1.0;
var k=0;
var valoreCercato=dati_ord[resultSelect.value];
while(valoreCercato!=dati[k]){
    k=k+1;
  }

feature = results[k];

// ?????????? problem----------------------
//parent.parent.mapFrame.ZoomToView(feature.centerX, feature.centerY, scale,
true);// ??????????

var map = GetParent().Fusion.getMapByName(mapName);// ??????????
map.ZoomToView(feature.centerX, feature.centerY, scale, true);// ??????????

}


</script>

all from example ..www\phpviewersample\query

but it does not work!

Can you help me, please?

Thank Alba

--
View this message in context: http://n2.nabble.com/Changing-current-selection-colour-tp1805368p2683842.html
Sent from the MapGuide Users mailing list archive at Nabble.com.

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

Re: [mapguide-users] Select and zoom to feature in Mapguide+Fusion

alba
hi Chris
thank you very much for your answer
it's very good for mg 2.0.2 but not for mg 2.0.1
I tested in both realizes
 
the selectionXml is valid too.
 
Sorry if you ask even more questions, but I need help
1.
 'map.setSelection(sel, true)' is not valid for multi selections! In this case, how I can do?
 
2.
 I think that the file C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\Help\viewerapi.html
is not update for mg 2.0.2, because the instruction 'setSelection'  does not exist
where I can download a new viewer api?
I must resolve this function
 
  function submitRequest(pageUrl)
  {
          xmlSel = parent.parent.mapFrame.GetSelectionXML();
          if(xmlSel=='') alert("Selezionare Area Incendio");
          else{
          mapScale = parent.parent.mapFrame.GetScale();
          mapHeight = 600;
          mapWidth = 600;
          mapCenter = parent.parent.mapFrame.GetCenter();
          params = new Array("SESSION", parent.parent.mapFrame.GetSessionId(),
            "MAPNAME", parent.parent.mapFrame.GetMapName(),
            "SELECTION", xmlSel,
            "SCALE", mapScale,
            "HEIGHT", mapHeight,
            "WIDTH", mapWidth,
            "CENTERX", mapCenter.X,
            "CENTERY", mapCenter.Y
            );
          parent.parent.formFrame.Submit(pageUrl, params, "_blank");
          }// fine else
     }
3.
I would use in mapguide 2.0.2 the same templates of mg 2.0.1 es: aqua, marron, ecc..
How can I do?
bye bye Alba
Reply | Threaded
Open this post in threaded view
|

Re: Select and zoom to feature in Mapguide+Fusion

alba
In reply to this post by Chris Claydon
hi Chris
thank you very much for your answer
it's very good for mg 2.0.2 but not for mg 2.0.1
I tested in both realizes

the selectionXml is valid too.

Sorry if you ask even more questions, but I need help
1.
 'map.setSelection(sel, true)' is not valid for multi selections! In this
case, how I can do?

2.
 I think that the file
C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\Help\viewerapi.html
is not update for mg 2.0.2, because the instruction 'setSelection'  does not
exist
where I can download a new viewer api?
I must resolve this function

  function submitRequest(pageUrl)
  {
          xmlSel = parent.parent.mapFrame.GetSelectionXML();
          if(xmlSel=='') alert("Selezionare Area Incendio");
          else{
          mapScale = parent.parent.mapFrame.GetScale();
          mapHeight = 600;
          mapWidth = 600;
          mapCenter = parent.parent.mapFrame.GetCenter();
          params = new Array("SESSION",
parent.parent.mapFrame.GetSessionId(),
            "MAPNAME", parent.parent.mapFrame.GetMapName(),
            "SELECTION", xmlSel,
            "SCALE", mapScale,
            "HEIGHT", mapHeight,
            "WIDTH", mapWidth,
            "CENTERX", mapCenter.X,
            "CENTERY", mapCenter.Y
            );
          parent.parent.formFrame.Submit(pageUrl, params, "_blank");
          }// fine else
     }

3.
I would use in mapguide 2.0.2 the same templates of mg 2.0.1 es: aqua,
marron, ecc..
How can I do?
  bye bye Alba

_______________________________________________
mapguide-users mailing list
[hidden email]
http://lists.osgeo.org/mailman/listinfo/mapguide-users
Reply | Threaded
Open this post in threaded view
|

RE: Select and zoom to feature in Mapguide+Fusion

Chris Claydon
The API for the AJAX Viewer is not the same as that for Fusion. I believe some people have had success using the MapGuideViewerApi.js file provided as part of the Fusion framework to provide near-compatibility. It might be valuable to ask on this list (or on the fusion mailing list) how others have integrated this file.

Chris.

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Albina Penitente
Sent: Friday, April 24, 2009 5:49 AM
To: MapGuide Users Mail List
Subject: Re: [mapguide-users] Select and zoom to feature in Mapguide+Fusion

hi Chris
thank you very much for your answer
it's very good for mg 2.0.2 but not for mg 2.0.1
I tested in both realizes

the selectionXml is valid too.

Sorry if you ask even more questions, but I need help
1.
 'map.setSelection(sel, true)' is not valid for multi selections! In this
case, how I can do?

2.
 I think that the file
C:\Programmi\MapGuideOpenSource2.0\WebServerExtensions\Help\viewerapi.html
is not update for mg 2.0.2, because the instruction 'setSelection'  does not
exist
where I can download a new viewer api?
I must resolve this function

  function submitRequest(pageUrl)
  {
          xmlSel = parent.parent.mapFrame.GetSelectionXML();
          if(xmlSel=='') alert("Selezionare Area Incendio");
          else{
          mapScale = parent.parent.mapFrame.GetScale();
          mapHeight = 600;
          mapWidth = 600;
          mapCenter = parent.parent.mapFrame.GetCenter();
          params = new Array("SESSION",
parent.parent.mapFrame.GetSessionId(),
            "MAPNAME", parent.parent.mapFrame.GetMapName(),
            "SELECTION", xmlSel,
            "SCALE", mapScale,
            "HEIGHT", mapHeight,
            "WIDTH", mapWidth,
            "CENTERX", mapCenter.X,
            "CENTERY", mapCenter.Y
            );
          parent.parent.formFrame.Submit(pageUrl, params, "_blank");
          }// fine else
     }

3.
I would use in mapguide 2.0.2 the same templates of mg 2.0.1 es: aqua,
marron, ecc..
How can I do?
  bye bye Alba

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