Skip to content

Commit 04d6e31

Browse files
updated nite overlay library to v1.4
1 parent 268793e commit 04d6e31

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

js/nite-overlay.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
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);

0 commit comments

Comments
 (0)