Hi Larry,
thanks for this info. I can count the marker now. But another problem
is that i have more than 200 records in a single time and its taking
too long time to create a markers with response. I am using ajax to
update records. When map move then i call function like
showmapAddress in the for loop. It will find the location according to
address and create a maker. But its not creating complete marker
according to fetched address. For example: if i have response of 200
address then it will create marker just for 30-50 records. Can you
please tell a better way to do this.
And I also want to display a message like "Please wait .. we are
updating the map.." when its updating the markers. I tried to display
message on the response time but not found any better way.
see below sample code, i am calling these functions in the loop to
create maker :-
function
showMapAddress(address1,address2,address3,addressF,bimage,auctionType,bedroom,bathroom,propID,auctID,venueId,startingbid,detailLink,lat,lng)
{
Overlay(createMarker(point,address1,address2,address3,addressF,bimage,auctionType,bedroom,bathroom,propID,auctID,venueId,startingbid,detailLink));
}
if(propID != undefined)
{
if (geocoder) {
geocoder.getLatLng(
addressF,
function(point) {
}
else{
map.addOverlay(createMarker(point,address1,address2,address3,addressF,bimage,auctionType,bedroom,bathroom,propID,auctID,venueId,startingbid,detailLink));
}
});
}
}
}
function
createMarker(point,address1,address2,address3,addressF,bimage,auctionType,bedroom,bathroom,propID,auctID,venueId,startingbid,detailLink)
{
var address = "<table cellpadding='0' cellspacing='4'
border='0'
><tr><td rowspan='4'><img src='"+bimage+"' class='imgbr' border='0'
width='55' height='50' /></td></tr><tr><td valign='top'><table
cellpadding='0' cellspacing='0' border='0' ><tr><td align='left'
style='color:#000000;'> Starting price "+startingbid+"</td></
tr><tr><td align='left' style='color:#000000;'> Bedroom "+bedroom
+", Bathroom "+bathroom+"</td></tr><tr><td style='color:#000000;'
align='left'> ";
if(userID != '' && userID!=null)
address+="<a href='javascript:void(0);'
onClick='saveListingsMap("+propID+","+auctID+")'>";
else
address+="<a href='javascript:void(0)'
onclick='login()'>";
address+="<span id='mapsave'>Save</span></
a> <a href='"+detailLink+"'>See details</
a></td></tr></table></td></tr></table>";
var icon = new GIcon(G_DEFAULT_ICON);
icon.image = IMAGE_BASE_PATH+auctionType+"-16x16.gif";
icon.iconSize = new GSize(17, 20);
var marker = new GMarker(point,icon);
GEvent.addListener(marker, "mouseover", function()
{
marker.openInfoWindowHtml(address);
});
GEvent.addListener(marker, "mouseout", function()
{
});
return marker;
}
Thanks,
Jets
On May 13, 7:18 pm, "[email protected]" <[email protected]>
wrote:
> On May 12, 12:42 pm, Jets <[email protected]> wrote:
>
> > Hi,
>
> > I want tocountthemarkerin the view area. If user zoom in then
> > how manymarkerin that currentmapview. I was trying to use
> > markermanager but its not working fine for me. Mainproblemis that
> > i have more than 200 markers in a single time and i have implement
> > some functionality like whenmapmove then it will update again to
> > find new location and create new markers. Is it any way tocount
> > themarkerin themapview.
>
> Returns the bounds of the visible
> area:http://code.google.com/apis/maps/documentation/javascript/v2/referenc...
>
> Tells you if a GLatLng is contained in that
> bounds:http://code.google.com/apis/maps/documentation/javascript/v2/referenc...
>
> Returns the GLatLng of
> amarker:http://code.google.com/apis/maps/documentation/javascript/v2/referenc...
>
> So:map.getBounds().containsLatLng(gmarkers[i].getLatLng())
>
> will tell you ifmarker"gmarkers[i]" is in view.
>
> -- Larry
>
>
>
>
>
>
>
>
>
> > Thanks,
> > Jets...
--
You received this message because you are subscribed to the Google Groups
"Google Maps API V2" 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.