> > <!DOCTYPE html> > > <html> > > <head> > > <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> > > <meta http-equiv="content-type" content="text/html; charset=UTF-8" /> > > <title>Google Maps JavaScript API v3 Example: Polygon Simple</title> > > <link >> href="http://code.google.com/apis/maps/documentation/javascript/examples/default.css" > > rel="stylesheet" type="text/css" /> > > > > <script type="text/javascript" >> src="http://maps.googleapis.com/maps/api/js?key=AIzaSyAwJriMKP5K8g7xVrj3nWYJIOw7-awGEj4&sensor=false"></script> > > >> <script type="text/javascript" src="data.js"></script> > > > > <script type="text/javascript"> > > > > function initialize() { > > var myLatLng = new google.maps.LatLng(21.037403, 105.84383); > > var myOptions = { > > zoom: 14, > > center: myLatLng, > > mapTypeId: google.maps.MapTypeId.ROADMAP > > }; > > >> >> >> var map = new google.maps.Map(document.getElementById("map"), >> myOptions); > > var lm = createOverlay(); > > lm.setMap(map); > > } > > >> >> function createOverlay() { > > >> var overlayCoords = new Array(); > > >> var processedData = rawData.split(";"); > > > > for (var i = 0; i < processedData.length; i++) { > > var xytd = processedData[i].split(","); > > > > overlayCoords.push(new google.maps.LatLng(xytd[0], >> xytd[1])); > > } > > >> >> // Construct the polygon > > var myOverLay = new google.maps.Polygon({ > > paths: createOverlay, > > editable: true, > > strokeColor: "#FF0000", > > strokeOpacity: 0.8, > > strokeWeight: 2, > > fillColor: "#FF0000", > > fillOpacity: 0.35 > > >> }); > > >> return myOverLay > > >> >> >> } > > >> </script> > > >> </head> > > <body onload="initialize()"> > > <div id="map" style="width: 550px; height: 450px"> > > </div> > > <form action="#"> > > <input type="button" name="Btload" value='Load' /> > > <input type="button" name="Btsave" value='Save' /> > > </form> > > </body> > > </html> > > >> I can't read from data.js to draw a polygon.
This is file data.js > var rawData1 = > "51.1830913,105.9052849;51.1832913,105.9091473;51.1826511,105.9051561;51.1826511,105.9051561"; > Can you help me?. Thank you so much. -- =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ Also find us on our blog and discussion group: http://adwordsapi.blogspot.com http://groups.google.com/group/adwords-api =~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~ You received this message because you are subscribed to the Google Groups "AdWords API Forum" 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/adwords-api?hl=en
