javascript - Drawing anonymous circles in Google Maps -


I'm trying to attract Google Maps with many circle overlays, though I do not want to reveal the correct center radius .

For example, myLatlng is my latitude / center center of the radius, I do not want to make a circle around it, but a circle which is included at that point .

In this way, I currently want to draw my circle:

  var myLatlng = new google.maps.LatLng (33.3333322.22222); Var circle = new google.maps.Circle ({map: radius: 3218, strokeColor: "#FFAA00", fillcolor: "# 00AAFF", fillOpacity: 0.3, center: myLatlng, zIndex: 99999,});   

33.3333322.22222 is a 'secret' place that I do not want to appear, though I want to point that point inside the circle.

Is this possible?

Thank you!

In your example code. The cycle can grow anywhere, such as 33.3 and 22.2 can still be included.

One way to do this is to just add a random offset.

  // random between -5 and 5 (just one example) var latOffset = Math.floor (Math.rendum) * 11) -5; Var longOffset = Math.floor (Math.Random) * 11) - 5; Var myLatlng = New google.maps.LatLng (33.33333 + Lateoffset, 22.22222 + Long Offset);   

You have a difficult bit to ensure that the random offset circle is not taken out of the range. The section on Wikipedia should help

Comments