Note that there are some explanatory texts on larger screens.

plurals
  1. POAlternative for point.x for google map api v3
    text
    copied!<p>This is a portion of code I'm working on: (this legacy code is drawing Circle using Polygon paths:</p> <pre><code> GEvent.addListener(bigmap_rad, 'click', function(overlay, cpoint) { var radius = document.getElementById('circle_radius').value; var c_center = new GLatLng(cpoint.y,cpoint.x); var c_marker = new GMarker(c_center); var latOffset = 0.01; var lonOffset = 0.01; var latConv = c_center.distanceFrom(new GLatLng(c_center.lat()+0.1, c_center.lng()))/100; var lngConv = c_center.distanceFrom(new GLatLng(c_center.lat(), c_center.lng()+0.1))/100; // nodes = number of points to create polygon var nodes = 40; // Create an array of points var cpoints = []; var pointbegain = null; // set the amount of steps from node var step = parseInt(360/nodes); // the for loop creates a series of points that define the circle, counting by the amount of steps, by 9 in the case of 40 nodes for(var i=0; i&lt;=360; i+=step){ var point1 = new GLatLng(c_center.lat() + (radius / latConv * Math.cos(i * Math.PI / 180)), c_center.lng() + (radius / lngConv * Math.sin(i * Math.PI / 180))); if(i==0){ pointbegain= point1; } cpoints.push(point1); } //cpoints.push(pointbegain); polygon = new GPolygon(cpoints, "#000000", 1, 1, "#8000000", 0.5); //bigmap_rad.addOverlay(polygon); </code></pre> <p>(Here bigmap_rad is a google map v2 Map object and cpoint is passed to that event listener)</p> <p>I am using this google map v2 code to turn it into v3 . But stumbled on this </p> <pre><code>var c_center = new GLatLng(cpoint.y,cpoint.x); </code></pre> <p>I cant find the alternative of this cpoint.y and cpoint.x for google map api v3. Please someone suggest me the solution. Thanks in advance.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload