PDA

View Full Version : user and u in one google map, find user location



webtasarimi
03-21-2009, 03:55 AM
test page (bottom)
http://www.flashwebtasarimi.com/iletisim.html#web_tasarim

user ip location and me distance line. this two points in one win.

operations
aa = "nokta[0]";
ab = "nokta[1]";
ba = "41.02987";
bb = "29.029098";
ka = (aa-ba);
kb = (ab-bb);
ca = (aa+ba) / 2;
cb = (ab+bb) / 2;
hipo = (ka*ka)+(kb*kb);
ara = sqrt(hipo);
yaklas = "9";
if(ara > 2.5) { yaklas = "8"; }
if(ara > 4) { yaklas = "7"; }
if(ara > 7) { yaklas = "6"; }
if(ara > 10) { yaklas = "5"; }
if(ara > 20) { yaklas = "4"; }
if(ara > 40) { yaklas = "3"; }
if(ara > 80) { yaklas = "2"; }
if(ara > 160) { yaklas = "1"; }
mesafe = round(ara*111);


<script type="text/javascript">
//<![CDATA[
function load() {
if (GBrowserIsCompatible()) {
var txt = "<div style=\"font-family:Arial,Helvetica,Sans Serif;font-size:11px;text-align:center\">";
txt += "Your distance to the FWT<br>";
txt += "Bulundugunuz yer kuş ušuşu<br>";
txt += "mesafe km<br>";
txt += "<a href=\"http://www.flashwebtasarimi.com\" target=\"_blank\" >flash web tasarimi<" + "/a>";
txt += "<" + "/div>";
var map = new GMap2(document.getElementById("map"));

var gelen = new GLatLng(aa,ab);
var fwt = new GLatLng(ba,bb);
var orta = new GLatLng(ca,cb);

var blueIcon = new GIcon(G_DEFAULT_ICON);
blueIcon.image = "http://www.flashwebtasarimi.com/sehir/fwt.gif";
markerOptions = { icon:blueIcon };

var polyline = new GPolyline([gelen,fwt], "#0000ff", 10);
map.addOverlay(polyline);

map.setCenter(orta,yaklas);
var marker = new GMarker(gelen);
var marker2 = new GMarker(fwt, markerOptions);
GEvent.addListener(marker, "click", function(){marker.openInfoWindowHtml(txt);});
map.addOverlay(marker);
map.addOverlay(marker2);

map.enableScrollWheelZoom();
map.addControl(new GSmallMapControl());
map.addControl(new GScaleControl());

}
}
//]]>
</script>

if u out map, pleace warn me

jscheuer1
03-21-2009, 12:50 PM
That's pretty cool. But if the user is using a proxy, it will show the location of the proxy or no map at all.

Schmoopy
03-21-2009, 01:19 PM
It gets my ISP and not my actual computer but I guess you can't do much about that.

webtasarimi
03-21-2009, 02:11 PM
first thanks, but i cant fint cable end :) if program change ip, i cant make anything
anyway i try show two poind in google map with zoom code.

and if u want use (1 or 2 mounth, this is demo)

<iframe src="http://www.flashwebtasarimi.com/sehir/misafir.PHP" frameborder="0" height="550" scrolling="No" width="750"></iframe>