mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Change from locations to dive sites in save-html and worldmap
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
4c87ccf952
commit
b7e53aaee6
2 changed files with 11 additions and 8 deletions
|
@ -172,8 +172,11 @@ void put_HTML_samples(struct membuffer *b, struct dive *dive)
|
||||||
|
|
||||||
void put_HTML_coordinates(struct membuffer *b, struct dive *dive)
|
void put_HTML_coordinates(struct membuffer *b, struct dive *dive)
|
||||||
{
|
{
|
||||||
degrees_t latitude = dive->latitude;
|
struct dive_site *ds = get_dive_site_for_dive(dive);
|
||||||
degrees_t longitude = dive->longitude;
|
if (!ds)
|
||||||
|
return;
|
||||||
|
degrees_t latitude = ds->latitude;
|
||||||
|
degrees_t longitude = ds->longitude;
|
||||||
|
|
||||||
//don't put coordinates if in (0,0)
|
//don't put coordinates if in (0,0)
|
||||||
if (!latitude.udeg && !longitude.udeg)
|
if (!latitude.udeg && !longitude.udeg)
|
||||||
|
@ -304,7 +307,7 @@ void write_one_dive(struct membuffer *b, struct dive *dive, const char *photos_d
|
||||||
put_format(b, "\"subsurface_number\":%d,", dive->number);
|
put_format(b, "\"subsurface_number\":%d,", dive->number);
|
||||||
put_HTML_date(b, dive, "\"date\":\"", "\",");
|
put_HTML_date(b, dive, "\"date\":\"", "\",");
|
||||||
put_HTML_time(b, dive, "\"time\":\"", "\",");
|
put_HTML_time(b, dive, "\"time\":\"", "\",");
|
||||||
write_attribute(b, "location", dive->location, ", ");
|
write_attribute(b, "location", get_dive_location(dive), ", ");
|
||||||
put_HTML_coordinates(b, dive);
|
put_HTML_coordinates(b, dive);
|
||||||
put_format(b, "\"rating\":%d,", dive->rating);
|
put_format(b, "\"rating\":%d,", dive->rating);
|
||||||
put_format(b, "\"visibility\":%d,", dive->visibility);
|
put_format(b, "\"visibility\":%d,", dive->visibility);
|
||||||
|
|
|
@ -27,11 +27,11 @@ void writeMarkers(struct membuffer *b, const bool selected_only)
|
||||||
if (!dive->selected)
|
if (!dive->selected)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (dive->latitude.udeg == 0 && dive->longitude.udeg == 0)
|
struct dive_site *ds = get_dive_site_for_dive(dive);
|
||||||
|
if (!ds || !dive_site_has_gps_location(ds))
|
||||||
continue;
|
continue;
|
||||||
|
put_degrees(b, ds->latitude, "temp = new google.maps.Marker({position: new google.maps.LatLng(", "");
|
||||||
put_degrees(b, dive->latitude, "temp = new google.maps.Marker({position: new google.maps.LatLng(", "");
|
put_degrees(b, ds->longitude, ",", ")});\n");
|
||||||
put_degrees(b, dive->longitude, ",", ")});\n");
|
|
||||||
put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '<div id=\"content\">'+'<div id=\"siteNotice\">'+'</div>'+'<div id=\"bodyContent\">");
|
put_string(b, "markers.push(temp);\ntempinfowindow = new google.maps.InfoWindow({content: '<div id=\"content\">'+'<div id=\"siteNotice\">'+'</div>'+'<div id=\"bodyContent\">");
|
||||||
snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Date:"));
|
snprintf(pre, sizeof(pre), "<p>%s ", translate("gettextFromC", "Date:"));
|
||||||
put_HTML_date(b, dive, pre, "</p>");
|
put_HTML_date(b, dive, pre, "</p>");
|
||||||
|
@ -49,7 +49,7 @@ void writeMarkers(struct membuffer *b, const bool selected_only)
|
||||||
put_HTML_watertemp(b, dive, pre, "</p>");
|
put_HTML_watertemp(b, dive, pre, "</p>");
|
||||||
snprintf(pre, sizeof(pre), "<p>%s <b>", translate("gettextFromC", "Location:"));
|
snprintf(pre, sizeof(pre), "<p>%s <b>", translate("gettextFromC", "Location:"));
|
||||||
put_string(b, pre);
|
put_string(b, pre);
|
||||||
put_HTML_quoted(b, dive->location);
|
put_HTML_quoted(b, get_dive_location(dive));
|
||||||
put_string(b, "</b></p>");
|
put_string(b, "</b></p>");
|
||||||
snprintf(pre, sizeof(pre), "<p> %s ", translate("gettextFromC", "Notes:"));
|
snprintf(pre, sizeof(pre), "<p> %s ", translate("gettextFromC", "Notes:"));
|
||||||
put_HTML_notes(b, dive, pre, " </p>");
|
put_HTML_notes(b, dive, pre, " </p>");
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue