locked
Different offesets for different infoboxes RRS feed

  • Question

  • Hello to everyone,

    Take a look at this page http://www.hotelinromania.ro/map.php.   As u can see I've used clustering for the shapes.   The big problem in this page is that on the shapes where I have used clustering , the infoboxes are laying over the shapes.   How can I change the offset of an infobox for a set of shapes?    or how can I change the body class name for  a set of shapes?   
    why the infobox is over the shape ?  I guess is the same offset for the regullar shapes generated on the map.  

    Thanks!
    Sunday, January 17, 2010 10:54 AM

Answers

All replies

  • Take a look at the VEShape.SetIconAnchor method: http://msdn.microsoft.com/en-us/library/bb429563.aspx
    Windows Live Developer MVP - http://rbrundritt.spaces.live.com
    Sunday, January 17, 2010 12:55 PM
    Moderator
  • sorry, my mistake   the "shapes" are pushpins   and  the  SetIconAnchor for a pushpin is ignored.

    So let me make myself clear.  I have positioned the pushpins in the right locations (left:-3px;position:absolute;top:-48px;).  The problem is the infoboxes are anchored in the old position (left:0px;top:0px;).  Now I want to bring up to the new position the infoboxes.  I do not want to use ImageOffset or SetIconAnchor because it moves my icon and not the infobox.    A found a way to move the infoboxes to the new position (from css .ero-progressAnimation { margin-left: 25px; margin-top: -16px; } .ero-leftBeak { margin-left: 30px; }), but it moves all the infoboxes on the map and I want to move just the clustered pushpin's infoboxes.


    this is the code


     for (var i=0; i < clusters.length; ++i)
       {
       var description="";
          var cluster = clusters[i];
          var clusterShape = cluster.GetClusterShape();
     
       for(var s=0;s<cluster.Shapes.length;s++)
       {
        var shape=cluster.Shapes[s];
           var coords = shape.GetPoints();
           //var link = shape.GetDescription();
        coords  = coords.toString();
        coords  = coords.split(',');
           description+='<br/><a  href="javascript:show_hotel('+coords[0]+','+coords[1]+',12)">'+shape.Title+'</a>';

       }
          clusterShape.SetTitle(cluster.Shapes.length + ' unitati de cazare'); 
          var CustomIconSpecification = new VECustomIconSpecification();
      CustomIconSpecification.Image = 'clusterr.png';

         
       clusterShape.SetCustomIcon(CustomIconSpecification);

          clusterShape.SetDescription(description);
    }





    How can I add an additional CSS class  only for the clustered pushpin's infoboxes?
    Sunday, January 17, 2010 2:29 PM