Changeset 7756 for trunk/src


Ignore:
Timestamp:
Apr 14, 2010, 10:02:45 AM (15 years ago)
Author:
janveeden
Message:

Selecting nodes for clusters done. For single nodes background still has to turn yellow

Location:
trunk/src/map
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/map/inc/node_info.php

    r7738 r7756  
     1
    12<?php
    23if(isset($_GET['view']))
     
    1314        else
    1415                $view = "gebruiker";
     16}
     17
     18if(isset($_GET['sel']))
     19{
     20        $selected = $_GET['sel'];
     21}
     22else
     23{
     24        $selected = "";
    1525}
    1626
     
    8797                <h2>
    8898                Lijst met nodes in deze cluster<br/>
    89                 <div id="clusterlist">
     99                <div id="clusterlist$selected">
    90100                <select multiple>
    91101EOF;
     
    106116EOF;
    107117}       
     118?>
  • trunk/src/map/inc/nodemapWL.js

    r7738 r7756  
    66var xmlhttp;
    77var targetDiv = "infotop";
     8var selected;
     9var overNode;
    810
    911//This function is called from index.php
     
    2426        }
    2527       
     28        GEvent.addListener(map, "click", function() {
     29                if(!overNode == true)
     30                        deSelect();
     31        });
     32       
    2633        var markerClusterer = new MarkerClusterer(map, markerArray);
    2734  }
     
    3946        //Added mouseover listener that calls on our mouseOver function when the mouse moves over a marker on the map
    4047        GEvent.addListener(marker, 'mouseover', function() {
    41         mouseOver(current.id, current.name[0]);
    42         });
     48        mouseOverNode(current.id, current.name[0]);
     49        });
     50        GEvent.addListener(marker, 'click', function() {
     51        mouseClickNode(current.id, current.name[0]);
     52        });
     53        GEvent.addListener(marker, 'mouseout', function() {
     54        mouseOutNode(current.id, current.name[0]);
     55        });
     56       
    4357        markerArray[i] = marker;
    4458        return marker;
    4559}
    4660
     61
    4762//Our mouseover function for single nodes. Gives the ID(our own given ID) and the name of the node.
    48 function mouseOver(id, name)
    49 {
    50         //this.obj = document.getElementById("infotop");
    51         loadXMLDoc("inc/node_info.php?type=single")
    52         //We will replace this function with a httprequest to a php file in the future
    53        
    54        
     63function mouseClickNode(id, name)
     64{
     65        selected = true;
     66        loadXMLDoc("inc/node_info.php?type=single");
    5567        /*
    5668        *Hieronder verdergaan met dekking
    5769        */
     70
     71}
     72//Our mouseover function for single nodes. Gives the ID(our own given ID) and the name of the node.
     73function mouseOverNode(id, name)
     74{
     75        if(!selected == true)
     76        {
     77                overNode = true;
     78                loadXMLDoc("inc/node_info.php?type=single");
     79                /*
     80                *Hieronder verdergaan met dekking
     81                */
     82               
     83        }       
     84}
     85
     86function mouseOutNode(id, name)
     87{
     88        overNode = false;
    5889}
    5990
     
    6192function mouseOverCluster(markers)
    6293{
     94        if(!selected == true)
     95        {
     96                //Make 'markers' array (containing gmarkers) into an array containing only the titles(names) of the markers
     97                var markerTitles = new Array;
     98                for(var i=0; i<markers.length; i++) {
     99                        markerTitles.push(markers[i].marker.getTitle());
     100                }
     101
     102                var markerTitleSerialized;
     103
     104                //start
     105                var a_php = "";
     106                var total = 0;
     107
     108                for (var i=0; i<markerTitles.length; i++)
     109                {
     110                        ++ total;
     111                        a_php = a_php + "s:" +
     112                                        String(i).length + ":\"" + String(i) + "\";s:" +
     113                                        String(markerTitles[i]).length + ":\"" + String(markerTitles[i]) + "\";";
     114                }
     115                a_php = "a:" + total + ":{" + a_php + "}";
     116                //end
     117
     118                loadXMLDoc("inc/node_info.php?type=cluster&markers="+a_php+"")
     119                /*
     120                *Hieronder verdergaan met dekking
     121                */
     122        }
     123}
     124
     125//Our click function for Cluster nodes. 'markers' is an array containing all markers within the cluster
     126function clickCluster(markers)
     127{
     128        //Let the rest of the program know that something is selected
     129        select();
     130
    63131        //Make 'markers' array (containing gmarkers) into an array containing only the titles(names) of the markers
    64132        var markerTitles = new Array;
     
    83151        //end
    84152       
    85         loadXMLDoc("inc/node_info.php?type=cluster&markers="+a_php+"")
    86         /*
    87         *Hieronder verdergaan met dekking
    88         */
    89 }
    90 
    91 //Our click function for Cluster nodes. 'markers' is an array containing all markers within the cluster
    92 function clickCluster(markers)
    93 {
    94        
    95 }
    96 
     153        loadXMLDoc("inc/node_info.php?type=cluster&markers="+a_php+"&sel=selected")
     154}
     155
     156function select()
     157{
     158        selected = true;
     159}
     160
     161function deSelect()
     162{
     163        selected = false;
     164        loadXMLDoc("inc/node_info.php");
     165}
    97166
    98167//Code from w3schools. http://www.w3schools.com/dom/dom_http.asp
  • trunk/src/map/index.php

    r7731 r7756  
    5151                <!-- Top information space -->
    5252                <div id="infotop">
    53                         <!-- Calling on the node information from an external php file. inc/node_info.php -->
     53                <!-- Calling on the node information from an external php file. inc/node_info.php -->
    5454                        <?php include("inc/node_info.php") ?>
    55                 </div>         
     55                </div>
    5656
    5757                <!-- Bottom information space -->
  • trunk/src/map/style/stylesheet.css

    r7738 r7756  
    2323}
    2424
     25#infotopselected {
     26border: 2px solid black;
     27height: 243px;
     28width: 100%;
     29background-color: yellow;
     30}
     31
    2532#clusterlist {
    2633margin-top: 10px;
     
    3138width: 100%;
    3239height: 130px;
     40}
     41
     42#clusterlistselected {
     43margin-top: 10px;
     44overflow: hidden;
     45background-color: yellow;
     46}
     47
     48#clusterlistselected select {
     49width: 100%;
     50height: 130px;
     51background-color: yellow;
    3352}
    3453
     
    4766margin-left: 5px;
    4867}
     68
    4969#timestamp {
    5070margin-right: 2px;
Note: See TracChangeset for help on using the changeset viewer.