Changeset 38681

Show
Ignore:
Timestamp:
11/19/10 00:17:05 (3 years ago)
Author:
NeoCat
Message:

Merge remote branch 'wa-/geomap-acc'

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • websites/twicli/plugins/geomap.js

    r38519 r38681  
    4040                {zoom: 13, center: latlng, mapTypeId: google.maps.MapTypeId.ROADMAP}); 
    4141        var marker = new google.maps.Marker({position: latlng, map: map}); 
     42 
     43        if(mapAccCircleOption.radius = coordinates.pop()) { 
     44                var accCircle = new google.maps.Circle(mapAccCircleOption); 
     45                accCircle.setCenter(latlng); 
     46                accCircle.setMap(map); 
     47        } 
     48 
    4249        google.maps.event.addListener(marker, 'click', function(event) { 
    4350                window.open('http://maps.google.com?q='+coordinates.join(",")); 
     
    4552} 
    4653 
     54var mapAccCircleOption = { 
     55        fillColor:      '#f37171', 
     56        fillOpacity:    0.3, 
     57        strokeColor:    '#f37171', 
     58        strokeOpacity:  0.7, 
     59        strokeWeight:   4 
     60}; 
     61 
     62function toggleGeoTag() { 
     63        if (!geowatch) { 
     64                geowatch = navigator.geolocation.watchPosition(function(g){ 
     65                        geo = g; 
     66                        var maplink = typeof(display_map) == 'function'; 
     67                        $("geotag-info").innerHTML = " : " + (maplink ? '<a href="javascript:display_map([geo.coords.latitude, geo.coords.longitude, geo.coords.accuracy], $(\'geotag-info\'))">' : '') + g.coords.latitude + ", " + g.coords.longitude + " (" + g.coords.accuracy + "m)" + (maplink ? '</a>' : ''); 
     68                        setFstHeight(null, true); 
     69                }); 
     70                $("geotag-img").src = "images/earth.png"; 
     71                $("geotag-st").innerHTML = "ON"; 
     72                $("geotag-info").innerHTML = " : -"; 
     73        } else { 
     74                navigator.geolocation.clearWatch(geowatch); 
     75                geo = geowatch = null; 
     76                $("geotag-img").src = "images/earth_off.png"; 
     77                $("geotag-st").innerHTML = "OFF"; 
     78                $("geotag-info").innerHTML = ""; 
     79                setFstHeight(null, true); 
     80        } 
     81} 
     82 
    4783document.write('<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>');