Commit 334da194 authored by Oleg Dzhimiev's avatar Oleg Dzhimiev

1. click on icon

2. disabled autopan for popup
parent a0d0d970
...@@ -189,6 +189,7 @@ function update_links(){ ...@@ -189,6 +189,7 @@ function update_links(){
var group = $(this).attr("group"); var group = $(this).attr("group");
var vlist = ""; var vlist = "";
var latest_version = "";
$(this).find("version").each(function(i,v){ $(this).find("version").each(function(i,v){
var comments = $(this).find("comments").text(); var comments = $(this).find("comments").text();
...@@ -215,11 +216,13 @@ function update_links(){ ...@@ -215,11 +216,13 @@ function update_links(){
var link = "<a title='"+comments+"' href='"+link_url+"'>"+$(this).attr("name")+"</a>,&nbsp;"; var link = "<a title='"+comments+"' href='"+link_url+"'>"+$(this).attr("name")+"</a>,&nbsp;";
vlist += link; vlist += link;
latest_version = $(this).attr("name");
}); });
vlist = vlist.slice(0,-7); vlist = vlist.slice(0,-7);
$(arow).attr("vlist",vlist); $(arow).attr("vlist",vlist);
markers[$(arow).attr("index")][0].vlist = vlist; markers[$(arow).attr("index")][0].vlist = vlist;
markers[$(arow).attr("index")][0].latest_version = latest_version;
var tmp = popup_message(markers[$(arow).attr("index")]); var tmp = popup_message(markers[$(arow).attr("index")]);
markers[$(arow).attr("index")][0]._popup.setContent(tmp); markers[$(arow).attr("index")][0]._popup.setContent(tmp);
}); });
...@@ -321,7 +324,22 @@ function parse_list(res){ ...@@ -321,7 +324,22 @@ function parse_list(res){
function popup_message(marker){ function popup_message(marker){
var msg = "<div><img class='pimg' alt='n/a' src='"+SETTINGS.basepath+"/"+marker[0].group+"/"+marker[0].name+"/thumb.jpeg' index='"+marker[0].index+"' ></img></div>"; var center = map.getCenter();
var zoom = map.getZoom();
var link_url = [
"viewer.html",
"?basepath="+SETTINGS.basepath,
"&group="+marker[0].group,
"&path="+marker[0].name,
"&ver="+marker[0].latest_version,
"&rating="+SETTINGS.rating,
"&lat="+center.lat.toFixed(8),
"&lng="+center.lng.toFixed(8),
"&zoom="+zoom
].join("");
var msg = "<div><a href='"+link_url+"'><img class='pimg' alt='n/a' src='"+SETTINGS.basepath+"/"+marker[0].group+"/"+marker[0].name+"/thumb.jpeg' index='"+marker[0].index+"' ></img></a></div>";
markers.forEach(function(c,i){ markers.forEach(function(c,i){
if (marker[0].lat==c[0].lat){ if (marker[0].lat==c[0].lat){
...@@ -381,6 +399,8 @@ function register_row_events(elem){ ...@@ -381,6 +399,8 @@ function register_row_events(elem){
// find all markers under this marker // find all markers under this marker
var tmp = popup_message(markers[index]); var tmp = popup_message(markers[index]);
markers[index][0]._popup.setContent(tmp); markers[index][0]._popup.setContent(tmp);
// autopan make popup always visible
markers[index][0]._popup.options.autoPan = false;
markers[index][0].openPopup(); markers[index][0].openPopup();
$(".plist").each(function(i,c){ $(".plist").each(function(i,c){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment