File tree Expand file tree Collapse file tree 1 file changed +5
-3
lines changed
Expand file tree Collapse file tree 1 file changed +5
-3
lines changed Original file line number Diff line number Diff line change 1- /* Nite v1.2
1+ /* Nite v1.4
22 * A tiny library to create a night overlay over the map
33 * Author: Rossen Georgiev @ https://github.com/rossengeorgiev
44 * Requires: GMaps API 3
@@ -47,7 +47,7 @@ var nite = {
4747 return this . sun_position ;
4848 } ,
4949 getShadowPosition : function ( ) {
50- return ( this . sun_position ) ? new google . maps . LatLng ( - this . sun_position . lat ( ) , - this . sun_position . lng ( ) + 180 ) : null ;
50+ return ( this . sun_position ) ? new google . maps . LatLng ( - this . sun_position . lat ( ) , this . sun_position . lng ( ) + 180 ) : null ;
5151 } ,
5252 refresh : function ( ) {
5353 if ( ! this . isVisible ( ) ) return ;
@@ -80,7 +80,7 @@ var nite = {
8080 var y = Math . tan ( rad * ( obliq_corr / 2 ) ) * Math . tan ( rad * ( obliq_corr / 2 ) ) ;
8181 var rq_of_time = 4 * ( ( y * Math . sin ( 2 * rad * mean_long_sun ) - 2 * eccent * Math . sin ( rad * mean_anom_sun ) + 4 * eccent * y * Math . sin ( rad * mean_anom_sun ) * Math . cos ( 2 * rad * mean_long_sun ) - 0.5 * y * y * Math . sin ( 4 * rad * mean_long_sun ) - 1.25 * eccent * eccent * Math . sin ( 2 * rad * mean_anom_sun ) ) / rad ) ;
8282 var true_solar_time = ( mins_past_midnight * 1440 + rq_of_time ) % 1440 ;
83- var lng = ( true_solar_time / 4 < 0 ) ? true_solar_time / 4 + 180 : true_solar_time / 4 - 180 ;
83+ var lng = - ( ( true_solar_time / 4 < 0 ) ? true_solar_time / 4 + 180 : true_solar_time / 4 - 180 ) ;
8484
8585 return new google . maps . LatLng ( lat , lng ) ;
8686 } ,
@@ -90,6 +90,8 @@ var nite = {
9090 } ,
9191 setMap : function ( map ) {
9292 this . map = map ;
93+ this . marker_shadow . setMap ( this . map ) ;
94+ this . marker_shadow_lite . setMap ( this . map ) ;
9395 } ,
9496 show : function ( ) {
9597 this . marker_shadow . setVisible ( true ) ;
You can’t perform that action at this time.
0 commit comments