Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dropping monument_random and using project instead of assuming wikipedia #21

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 7 additions & 5 deletions ajaxmonuments.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,12 @@
if ($withImages == '1'){
$imageCondition = "image != ''";
}
$sql="SELECT country, lang, id, name, lat, lon, municipality, address, image, commonscat, monument_article, monument_random, source " .
"FROM monuments_all " .
"WHERE lon>=:left AND lon<=:right AND lat>=:bottom AND lat<=:top AND " . $imageCondition . " " .
"ORDER BY monument_random " .
"LIMIT " . $limit;
$sql = "SELECT country, lang, id, name, lat, lon, image, commonscat, " .
"monument_article, municipality, address, source, project " .
"FROM monuments_all " .
"WHERE lon>=:left AND lon<=:right AND lat>=:bottom AND lat<=:top " .
"AND " . $imageCondition . " " .
"LIMIT " . $limit;
$stmt = $db->prepare($sql);
$stmt->bindParam(':left', $left, PDO::PARAM_STR);
$stmt->bindParam(':right', $right, PDO::PARAM_STR);
Expand Down Expand Up @@ -107,6 +108,7 @@
$prop['municipality']=$row['municipality'];
$prop['address']=$row['address'];
$prop['lang']=$row['lang'];
$prop['project']=$row['project'];
$prop['id']=$row['id'];
$prop['name']=explode('|', $row['name']);
$prop['name']=str_replace(array('[', ']'), '', $prop['name'][0]);
Expand Down
4 changes: 2 additions & 2 deletions wlm-maps.js
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ function getwebsite (country) {
}

function init() {
var osmUrl='//{s}.tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmUrl='//tile.openstreetmap.org/{z}/{x}/{y}.png';
var osmAttrib=translatemsg('osm-attrib');

withimageicon=L.icon({
Expand Down Expand Up @@ -289,7 +289,7 @@ function setMarker(feature,latlng) {
popuptext = popuptext + '<table border=0 width=350px>';
if (feature.properties.monument_article)
{
popuptext = popuptext + '<tr><td colspan=3><strong><a href="//'+feature.properties.lang+'.wikipedia.org/wiki/'+feature.properties.monument_article+'" target="_blank">'+feature.properties.name+'</a></strong></td></tr>';
popuptext = popuptext + '<tr><td colspan=3><strong><a href="//'+feature.properties.lang+'.'+feature.properties.project+'.org/wiki/'+feature.properties.monument_article+'" target="_blank">'+feature.properties.name+'</a></strong></td></tr>';
}else{
popuptext = popuptext + '<tr><td colspan=3><strong>'+feature.properties.name+'</strong></td></tr>';
}
Expand Down