Algebra na Geometry… olee mgbe m ga-eji ya? Maapụ Google!

Ihe ngbanwe ihuenyo 2014 10 23 na 3.24.52 PM

Ezigbo enyi m, Glenn, bụ otu n’ime ndị bidoro Family Watchdog. Ezigbo ezinụlọ bụ otu n'ime akụkọ ndị ahụ dị egwu… ụlọ ọrụ hiwere na mashup nke na-arụ ọrụ ọha na eze NA-enyekwa ndị bi na ya ndụ. Ọ ga-abụ ihe ịtụnanya na ị ga-arụ ọrụ kwa ụbọchị na-amata na ịmeela mgbanwe. Oge ọ bụla m hụrụ Glenn, ọ na-arụ ọrụ dị ka onye nzuzu na ịhụkwa nkeji ọ bụla n’anya.

N'abalị a ka m nyere Glenn aka na nsogbu Google Map. Achọrọ m ịkọrọ gị otu… na-ese gburugburu na Google Maps. Ọ na-efesa (dịka m maara), ị nweghị ike ịbịaru gburugburu. Agbanyeghị, ịnwere ike ịdepụta polylines ma tụlee ha dịka ịchọrọ. Yabụ, enwere ike wulite koodu ahụ ka ọ tinye naanị ngalaba 36 ọnụ ma belata nkedo ahụ ka ha gbakwunye ma wuo gburugburu zuru oke!

Ejiri polylines dee ya VML (asụsụ vekratu asụsụ), ya mere ekwesịrị igosi ya na nkụnye eji isi mee nke faịlụ ahụ ka ntụgharị wee nye ha nke ọma. Firefox na-eme ya na akpaghị aka (n'ezie!).

Nke a bụ ihe mpempe akwụkwọ nke ga-adọta gburugburu 1 kilomita gburugburu ụlọ gị.

var PGlat = (PGradius / 3963) * 180 / Math.PI; // iji 3963 kilomita dị ka okirikiri ụwa dị na kilomita ma ọ bụrụ na (PGwidth! = 0) {var PGlng = PGlat / Math.cos (PGcenter.lat () * Math.PI / 180); maka (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 (GLatLng ohuru (PGy, PGx)); }; map.addOverlay (GPolyline ọhụrụ (PGpoints, PGcolor, PGwidth, PGtrans)); } ọzọ {var PxWidth = Math.round (PGlat * yyPx / latSpan + 0.5); // obosara nke polyline var deltaLat = 250 * latSpan / yyPx; ọ bụrụ na (PxWidth> 500) {PxWidth = 500; PGlat - = deltaLat; } ọzọ {PGlat / = 2; };

Lelee ihe ngosi dum iji hụ koodu ahụ n'uju. Emere m gafee ọrụ na saịtị a ebe ọ nwere ọtụtụ gburugburu nke okirikiri na otu eserese nwere mpaghara mkpuchi.

Kedu ihe ị chere?

Ebe a na-eji Akismet iji belata spam. Mụta otu esi etinye usoro data gị.