Query windows improved

fernao - December 21, 2005 - 19:11
Project:Carto - opengis web mapping
Version:4.6.x-1.x-dev
Component:Miscellaneous
Category:feature request
Priority:normal
Assigned:fernao
Status:active
Description

Hi there

I want to improve the query info window, to display formatted text, dynamically load a thumbnail etc.
Have anyone made something like this before?

Thanks

#1

jpulles - December 23, 2005 - 10:08

Hi Fernao,

The present implementation of feature info display is indeed very basic: inside the mappingwidgets simplemap.js file, the feature info response is either shown as is in a window or alert box.
This can easily be changed in displaying the response in a html element on your page; for this I am adding a DocumentElement widget type at the moment.

Problem with the feature info response is that the output is not constant; different map servers can return different text. When using an xsl to format the text, it can be applied server side or client side.
What are your ideas about how to solve it?

Greetings,
John.

#2

fernao - January 9, 2006 - 19:44

Maybe XML + XSL could solve it.

I've found an article (Improving WMS GetFeatureInfo

#3

fernao - January 9, 2006 - 20:06

oops!

So, that article gives and option on displaying the GetFeatureInfo in a different way.
I still didn't understood how can I use the DocumentElement. It passes a posted form element, that's it?

#4

jpulles - January 9, 2006 - 20:45

At the present, the DocumentElement widget is not yet available in the current mappingwidgets version. It will be in the next.
It's purpose is to serve as a destination for the feature info response. And, as you suggest, it should be possible to apply an xsl stylesheet to the response. Using this widget, you can then define a custom block that will display the feature info response.

#5

fernao - January 9, 2006 - 20:51

Here is a thread talking about this, also:

http://lists.eogeo.org/pipermail/wms-dev/2004-October/000602.html

#6

fernao - April 5, 2006 - 22:08
Component:User interface» Miscellaneous

Hi there

After some time, I've solved my problem just with the drupal tools. The objective was to create an integration between drupal and the maps.

By navegating on the map, I click on a queryable area, that is associated with a NID (node id number).
I've associated all those NIDs in my postgis database, adding a column for it.

So, this query goes to a template page, that is, actually, a refresh page. It gets the posted values from mapserver and fills a form, resendind it to a drupal page specially created for it (called "popup"). This was the only way to get the data from mapserver.

Map

The drupal popup page has a custom php code that gets the nid from the clicked area on the map and associates it with the related node. So, I can work with images, fields and every other data of it. So, this popup now acts as another navegating tool, with photos or any other data from that node:

<?php
$nid
= $_POST['nid'];

$arrNode = array();
$arrNode["nid"] = $nid;
$node = node_load($arrNode);
?>

// change Page
function changePage(nid){
defaultLoc = "http://tombados-linux/cms/node/";
window.opener.location = defaultLoc + nid;
window.self.close();
}

function back(){
window.opener.refresh(-1);
}

<?php
echo $node->name
?>

Go to node!

I hope it works for another people too!
:)

#7

fernao - April 5, 2006 - 22:10

(sorry for the last one, not well formatted)

Hi there

After some time, I've solved my problem just with the drupal tools. The objective was to create an integration between drupal and the maps.

By navegating on the map, I click on a queryable area, that is associated with a NID (node id number).
I've associated all those NIDs in my postgis database, adding a column for it.

So, this query goes to a template page, that is, actually, a refresh page. It gets the posted values from mapserver and fills a form, resendind it to a drupal page specially created for it (called "popup"). This was the only way to get the data from mapserver.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>Map</title>
  </head>
  <body onload="document.forms[0].submit();">
    <form action="http://tombados-linux/cms/mapa/popup" method="post">
      <input type="hidden" name="nid" value="[nid]">
    </form>
  </body>
</html>

The drupal popup page has a custom php code that gets the nid from the clicked area on the map and associates it with the related node. So, I can work with images, fields and every other data of it. So, this popup now acts as another navegating tool, with photos or any other data from that node:

<?php

$nid
= $_POST['nid'];

$arrNode = array();
$arrNode["nid"] = $nid;
$node = node_load($arrNode);

?>

<script language="javascript">
// change Page
function changePage(nid){
  defaultLoc = "http://tombados-linux/cms/node/";
  window.opener.location = defaultLoc + nid;
  window.self.close();
}

function back(){
  window.opener.refresh(-1);
}
</script>
<table>
<tr>
  <td bgcolor='#006699' class='popup-title'>
<strong><?php echo $node->name ?></strong>
  </td>
</tr>
<tr>
  <td>
    <img  src="<?php echo $node->img_url; ?>">
  </td>
</tr>
<tr>
  <td>
   <a href='javascript:void(0);changePage(<?php echo $nid ?>)';>Go to node!</a>
  </td>
</tr>
</table>
</html>

I hope it works for another people too!
:)

#8

jpulles - April 7, 2006 - 23:00

Do you perhaps have a demo available on the internet?

#9

fernao - April 19, 2006 - 19:19

The system in working in an intranet, for now. So, here goes some screenshots

The first one is the map. Selecting the "query" tool, a popup window is opened (passing the query values). The first page, of the query, is the "template" line in the mapfile.

I didn't have sucess in getting the values directly from the query, because of the format of template. So, I've putted this value filling a form, that would be sent to another page.

This second page is a drupal normal page, with all the blocks hidden for this type (popup, that I've created). In this page I can track the value from the query and realize an integration with drupal.

Remembering: I've added a column with the NID (node ID) in the map database. So, this NID can be retrieved and the integration could be done.

So, the user receives a popup window that calls all those information from that drupal nid (second image). In this page,I've putted a link to get directly to the node page.

#10

fernao - April 19, 2006 - 19:20

Screenshot 1

AttachmentSize
funcionamento_carto_popup1.jpg 75.22 KB

#11

fernao - April 19, 2006 - 19:20

Screenshot 2

AttachmentSize
funcionamento_carto_popup2.jpg 78.12 KB

#12

fernao - April 19, 2006 - 19:21

Screenshot 3

AttachmentSize
funcionamento_carto_popup3.jpg 69.9 KB
 
 

Drupal is a registered trademark of Dries Buytaert.