Results 1 to 4 of 4

Thread: user and u in one google map, find user location

  1. #1
    Join Date
    May 2008
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Exclamation user and u in one google map, find user location

    test page (bottom)
    http://www.flashwebtasarimi.com/ilet...ml#web_tasarim

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

    operations
    Code:
    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

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    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.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Sep 2008
    Location
    Bristol - UK
    Posts
    842
    Thanks
    32
    Thanked 132 Times in 131 Posts

    Default

    It gets my ISP and not my actual computer but I guess you can't do much about that.

  4. #4
    Join Date
    May 2008
    Posts
    13
    Thanks
    3
    Thanked 0 Times in 0 Posts

    Default

    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)
    Code:
    <iframe src="http://www.flashwebtasarimi.com/sehir/misafir.PHP" frameborder="0" height="550" scrolling="No" width="750"></iframe>

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •