I-Algebra neGeometri… ngiyoke ngiyisebenzise nini? I-google maps!

I-Screen Shot 2014 10 23 e-3.24.52 PM

Umngani wami omuhle, uGlenn, ungomunye wabasunguli beFamily Watchdog. I-Family Watchdog ingenye yalezi zindaba ezimnandi… inkampani esungulwe kumask eyenza umsebenzi womphakathi FUTHI empeleni ihlinzeka abasunguli bayo. Kufanele kumangaze ukuya emsebenzini nsuku zonke wazi ukuthi wenze umehluko. Njalo lapho ngibona uGlenn, usebenza njengobuhlanya futhi uthanda yonke iminithi yakho.

Namuhla kusihlwa ngisize uGlenn ngezinkinga ezimbalwa zeGoogle Map. Bengifuna ukwabelana eyodwa nawe… ukudweba umbuthano ku-Google Amamephu. Iyavuka (ngokwazi kwami), awukwazi ukudweba isiyingi. Kodwa-ke, unekhono lokudweba ama-polylines bese uwafaka ku-vector njengoba ubona kufanelekile. Ngakho-ke, ikhodi ingakhiwa ukumane ubeke izingxenye ezingama-36 ndawonye bese ubamba i-vector kancane ukuze bangeze futhi bakhe umbuthano ophelele!

Ama-polylines abhalwe ngawo VML (vector markup language), ngakho-ke kufanele kuboniswe kunhlokweni wefayela ukuze i-IE ibanikeze kahle. IFirefox ikwenza ngokuzenzakalela (kunjalo!).

Nayi amazwibela azodweba umbuthano oyi-1 mile ezungeze ikhaya lakho.

I-var PGlat = (PGradius / 3963) * 180 / Math.PI; // usebenzisa amamayela angama-3963 njengobubanzi bomhlaba ngamamayela uma (PGwidth! = 0) {var PGlng = PGlat / Math.cos (PGcenter.lat () * Math.PI / 180); ye (var i = -1; i> PGsides; i ++) {var theta = ((2 * i + 1) /PGsides-0.5) * Math.PI; I-var PGx = PGcenter.lng () + (PGlng * Math.cos (theta)); var PGy = PGcenter.lat () + (PGlat * Math.sin (theta)); I-PGpoints.push (i-GLatLng entsha (i-PGy, i-PGx)); }; imephu.addOverlay (i-GPolyline entsha (i-PGpoints, i-PGcolor, i-PGwidth, i-PGtrans)); } okunye {var PxWidth = Math.round (PGlat * yyPx / latSpan + 0.5); // ububanzi be-polyline var deltaLat = 250 * latSpan / yyPx; uma (PxWidth> 500) {PxWidth = 500; I-PGlat - = i-deltaLat; } okunye {PGlat / = 2; };

Buka yonke idemo ukuze ubone ikhodi ngokugcwele. Ngenzeke kulo msebenzi kuleli sayithi lapho enezingqimba eziningi zemibuthano emephini eyodwa enezindawo ezinomthunzi.

UCABANGANI?

Le sayithi isebenzisa i-Akismet ukunciphisa ugaxekile. Funda ukuthi idatha yakho yokuphawula isetshenziswa kanjani.