On Sep 14, 12:27 am, Rakesh <[email protected]> wrote:
> Hi,
> I tried to draw 1000 Circle on Google Maps, using a function with the
> help of For loop , Called function code is mentioned below.
> but the draw back is that it takes around 50-60 second and show message
> (s)
>
> "Stop running this script?
> A Script on this page is causing internet Explore is run slowly.
> If it continue to run, your computer may become unresponsive"
>
> Kindly suggest me how i can implement 1000 circle in different
> location with fast speed atleast in 5-10 second on map.
Use custom tiles or a manager that only allows a few hundred to be
displayed at a time. More than 200 of _anything_ (markers,
polylines, polygons) on a Google Map API based map is going to have
performance issues (more on IE, less on other browsers).
-- Larry
>
> //Give function for draw circle.
> function drawCircle(lat, lng, radius, strokeColor, strokeWidth,
> strokeOpacity, fillColor, fillOpacity) {
> var d2r = Math.PI/180;
> var r2d = 180/Math.PI;
> var Clat = radius * 0.014483; // Convert statute miles into
> degrees latitude
> var Clng = Clat/Math.cos(lat*d2r);
> var Cpoints = [];
> for (var i=0; i < 33; i++) {
> var theta = Math.PI * (i/16);
> Cy = lat + (Clat * Math.sin(theta));
> Cx = lng + (Clng * Math.cos(theta));
> var P = new GLatLng(Cy, Cx);
> Cpoints.push(P);
> }
> var polygon = new GPolygon(Cpoints, strokeColor, strokeWidth,
> strokeOpacity, fillColor, fillOpacity);
> map.addOverlay(polygon);
> }
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---