<script type="text/javascript" src="javascript/jquery-latest.js"></
script>
<script>
var $j = jQuery.noConflict();
</script>
<script language="javascript" type="text/javascript" src="javascript/
mapiconmaker.js"></script>

<script type="text/javascript" src="javascript/prototype.js"></script>

 <script src="http://maps.google.com/maps?...";></script>
<script>

$j(document).ready(function()
{

        var markers2 ;

  $j("#printBtn").text("");

$j("#distance").numeric();

        $j("#areakind").change(function()
                {

                        $j("#drawnIds").text('');

                var selectedval=$j("#areakind").val();

                if(selectedval==0)      $j("#keyField").val('0'); else
$j("#keyField").val('1');


                var map;
                var blueIcon;
                var markerOptions2;


                var markers2 = $A();

        pois2 = $A();

                var overlay;

                var timerStep = 0;
                var timerId;


                var poisinfo2=new Array();
                var apoint2;


                getsavedMarkers(poisinfo2,apoint2);


                  alert('pois2 after getsavedMarkers:'+pois2.length +'
ln2:'+poisinfo2.length)
                clearOverlaysfunction();


                 loadallMarkers (selectedval,poisinfo2,pois2);


                });

});

function loadallMarkers(selectedval,poisinfoT,poisT){

var value;
       var blueIcon = new GIcon(G_DEFAULT_ICON);
                blueIcon.image = "img/blank.png";

                markerOptions = { icon:blueIcon };


        for (var i=0; i<poisinfoT.length; i++) {
                poisT[poisT.length]=new GMarker(new GLatLng(poisinfoT[i]
[0],poisinfoT[i][1]), markerOptions);

              }

  map.clearOverlays();


 var searchUrl = file.php?kind='+selectedval ;

 GDownloadUrl(searchUrl, function(data) {


          var xml = GXml.parse(data);
          var markers =
xml.documentElement.getElementsByTagName("marker");

                for (var i = 0; i < markers.length; i++) {

                ///////////////// Other /////////////////////////
                var other="";

                 if (lat != '' & lng !='') {

                 var projectName = markers[i].getAttribute('projectName');
                 var type = markers[i].getAttribute('type');


                 var area =0;
                 var photo = markers[i].getAttribute('image');
                 var lat = markers[i].getAttribute('lat');
                 var lng = markers[i].getAttribute('lng');
                 var id = markers[i].getAttribute('id');
                 var weburl=markers[i].getAttribute('weburl');
                 var 
propertykindname=markers[i].getAttribute('propertykindname');
             var markercolor=markers[i].getAttribute('markercolor');


                 var description = markers[i].getAttribute('description');

         var point =new
GLatLng(markers[i].getAttribute("lat"),markers[i].getAttribute("lng"));

                  var marker =
createMarker(projectName,type,area,photo,point,markercolor,id,other,weburl);
          map.addOverlay(marker);

                  value=id+',';
                   $j("#drawnIds").append(value);

                        }//end if

                        }//end

          });


                GPolygon.prototype.contains = function(point) {
                var j=0;
                var oddNodes = false;
                var x = point.lng();
                var y = point.lat();

                //with math.round
                var x1 = Math.round(point.lng()*100)/100;
                var y1 = Math.round(point.lat()*100)/100;


                for (var i=0; i < this.getVertexCount(); i++) {
                        j++;
                        if (j == this.getVertexCount()) {j = 0;}
                        if (((this.getVertex(i).lat() < y) && 
(this.getVertex(j).lat() >=
y))
                                        || ((this.getVertex(j).lat() < y) && 
(this.getVertex(i).lat() >=
y))) {


                                if ( this.getVertex(i).lng() + (y - 
this.getVertex(i).lat())
                                        /  
(this.getVertex(j).lat()-this.getVertex(i).lat())
                                        *  (this.getVertex(j).lng() - 
this.getVertex(i).lng())<x ) {

                                        oddNodes = !oddNodes;

                                        }
                                }


                        }


                return oddNodes;
                }

}//end function

These markers should be drawn after chosed type from select box & then
draw circle & show containing markers inside the circle drawn
But the problem is that  circle is drawn correctly  but with no
markers inside it knowing that there exist saved marker inside the
drawn zone.
Even when request to draw circle with given raduis & not choosing type
from checkbox...most of time markers inside circle not drawn.
Is this because of using prototype & onchange event of jquery ??

Hope anyone could help!!!

-- 
You received this message because you are subscribed to the Google Groups 
"Google Maps API" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-maps-api?hl=en.

Reply via email to