Algebra ndi Jometry… ndiziigwiritsa ntchito liti? Google Maps!

Screen Shot 2014 10 23 ku 3.24.52 PM

Mnzanga wapamtima, Glenn, ndi m'modzi mwa omwe adayambitsa Family Watchdog. Family Watchdog ndi imodzi mwazosangalatsa ... kampani yomwe idakhazikitsidwa pamashup yomwe ikugwira ntchito yothandiza anthu ndipo imapezera ndalama oyambitsa. Ziyenera kukhala zodabwitsa kupita kuntchito tsiku lililonse ndikudziwa kuti mwasintha. Nthawi iliyonse ndikamuwona Glenn, amagwira ntchito ngati wopenga ndipo amakonda mphindi iliyonse.

Usikuuno ndathandizira Glenn ndi nkhani zingapo za Google Map. Ndikufuna kugawana chimodzi nanu… kujambula bwalo pa Google Maps. Zimatha (monga momwe ndikudziwira), simungathe kujambula bwalo. Komabe, mumatha kujambula ma polylines ndikuwasindikiza momwe mukuonera. Chifukwa chake, codeyo itha kupangika kuti ingoyika magawo 36 palimodzi ndikusanja vekitala pang'ono kuti iwonjezere ndikupanga bwalo lathunthu!

Ma polylines amalembedwa nawo VML (vector markup language), chifukwa chake iyenera kuwonetsedwa pamutu wa fayilo kuti IE iwapatse bwino. Firefox imachita zokha (zachidziwikire!).

Nayi chidule chomwe chijambula bwalo 1 mile kuzungulira nyumba yanu.

var PGlat = (PGradius / 3963) * 180 / Math.PI; // kugwiritsa ntchito ma 3963 mamailosi ngati kutalika kwa dziko lapansi mamailosi ngati (PGwidth! = 0) {var PGlng = PGlat / Math.cos (PGcenter.lat () * Math.PI / 180); za (var i = -1; i> PGsides; i ++) {var theta = ((2 * i + 1) /PGsides-0.5) * Math.PI; var PGx = PGcenter.lng () + (PGlng * Math.cos (theta)); var PGy = PGcenter.lat () + (PGlat * Math.sin (theta)); PGpoints.push (yatsopano GLatLng (PGy, PGx)); }; map.addOverlay (GPolyline yatsopano (PGpoints, PGcolor, PGwidth, PGtrans)); } zina {var PxWidth = Math.round (PGlat * yyPx / latSpan + 0.5); // kutalika kwa polyline var deltaLat = 250 * latSpan / yyPx; ngati (PxWidth> 500) {PxWidth = 500; PGlat - = deltaLat; } wina {PGlat / = 2; };

Onani chiwonetsero chonse kuti muwone nambala yonse. Ndidakumana ndi ntchito patsamba lino pomwe ali ndi mizere ingapo pamapu amodzi okhala ndi mithunzi.

Mukuganiza chiyani?

Tsambali likugwiritsa ntchito Akismet kuchepetsa spam. Phunzirani momwe deta yanu ikufotokozera.