Skip to content

Commit

Permalink
website update
Browse files Browse the repository at this point in the history
  • Loading branch information
gka committed Jun 23, 2012
1 parent c741764 commit dc406a0
Show file tree
Hide file tree
Showing 5 changed files with 660 additions and 188 deletions.
56 changes: 56 additions & 0 deletions showcase/editor/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -54,6 +54,15 @@
this.sea = true; this.sea = true;
this.lakes = false; this.lakes = false;
this.mode = 'bbox'; this.mode = 'bbox';

this.offsetx = 0;
this.offsety = 0;
this.startx = 0;
this.starty = 0;
this.deltalon = 0;
this.deltalat = 0;
this.isdragged = false;
this.firstclick = true;
//this.flip = 0; //this.flip = 0;
}; };
var globeopt = new GlobeOpt(); var globeopt = new GlobeOpt();
Expand Down Expand Up @@ -311,6 +320,53 @@


updateGUI(); updateGUI();


$('#map-parent').click(function (e) {
globeopt.startx = e.pageX - this.offsetLeft;
globeopt.starty = e.pageY - this.offsetTop;
});
$('#map-parent').mousedown(function (e) {
globeopt.isdragged = true;
});
$('#map-parent').mouseup(function (e) {
globeopt.isdragged = false;
globeopt.firstclick = true;
$('#status2').html((e.pageX - globeopt.offsetx - globeopt.startx) + ', ' + (e.pageY - globeopt.offsety - globeopt.starty));
});
var latstart = 0,
lonstart = 0,
lastlat = 0,
lastlon = 0;
$('#map-parent').mousemove(function (e) {
globeopt.offsetx = this.offsetLeft;
globeopt.offsety = this.offsetTop;
$('#status').html(e.pageX + ', ' + e.pageY);
if (globeopt.isdragged === true) {
lastlat = globeopt.lat0;
lastlon = globeopt.lon0;
if (globeopt.firstclick === true) {
globeopt.startx = e.pageX - globeopt.offsetx;
globeopt.starty = e.pageY - globeopt.offsety;
latstart = globeopt.lat0;
lonstart = globeopt.lon0;
globeopt.firstclick = false;
}
var relx = e.pageX - globeopt.offsetx - globeopt.startx;
var rely = e.pageY - globeopt.offsety - globeopt.starty;
//$('#status').html(relx +', '+ rely);
globeopt.deltalon = (-relx / 4);
globeopt.deltalat = (rely / 4);
globeopt.lon0 = (lonstart + globeopt.deltalon + 540) % 360 - 180;
globeopt.lat0 = latstart + globeopt.deltalat;
if (globeopt.lat0 > 90) {globeopt.lat0 = 90; }
if (globeopt.lat0 < -90) {globeopt.lat0 = -90; }
//$('#relxystatus').html(globeopt.deltalat +'°'+ globeopt.deltalon + '°');
$('#latlonstatus').html((Math.floor(globeopt.lat0)) + '°, ' + (Math.floor(globeopt.lon0)) + '°');
if (globeopt.lat0 !== lastlat || globeopt.lon0 !== lastlon) {
renderFrame();
}
}
});

}); });


if (location.href.substr(0, 22) != 'http://localhost:4000/') { if (location.href.substr(0, 22) != 'http://localhost:4000/') {
Expand Down
57 changes: 56 additions & 1 deletion showcase/projections/index.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -34,8 +34,16 @@
this.up = 0; this.up = 0;
this.tilt = 0; this.tilt = 0;
this.proj = 'ortho'; this.proj = 'ortho';
this.projstr = '+proj=lcc +lat_1=44.1 +lat_0=44.1 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m' this.projstr = '+proj=lcc +lat_1=44.1 +lat_0=44.1 +lon_0=0 +k_0=0.999877499 +x_0=600000 +y_0=200000 +a=6378249.2 +b=6356515 +towgs84=-168,-60,320,0,0,0,0 +pm=paris +units=m',
//this.flip = 0; //this.flip = 0;
this.offsetx = 0;
this.offsety = 0;
this.startx = 0;
this.starty = 0;
this.deltalon = 0;
this.deltalat = 0;
this.isdragged = false;
this.firstclick = true;
}; };
var globeopt = new GlobeOpt(); var globeopt = new GlobeOpt();
var url = location.href.split('#'); var url = location.href.split('#');
Expand Down Expand Up @@ -208,6 +216,53 @@


updateGUI(); updateGUI();


$('#map-parent').click(function (e) {
globeopt.startx = e.pageX - this.offsetLeft;
globeopt.starty = e.pageY - this.offsetTop;
});
$('#map-parent').mousedown(function (e) {
globeopt.isdragged = true;
});
$('#map-parent').mouseup(function (e) {
globeopt.isdragged = false;
globeopt.firstclick = true;
$('#status2').html((e.pageX - globeopt.offsetx - globeopt.startx) + ', ' + (e.pageY - globeopt.offsety - globeopt.starty));
});
var latstart = 0,
lonstart = 0,
lastlat = 0,
lastlon = 0;
$('#map-parent').mousemove(function (e) {
globeopt.offsetx = this.offsetLeft;
globeopt.offsety = this.offsetTop;
$('#status').html(e.pageX + ', ' + e.pageY);
if (globeopt.isdragged === true) {
lastlat = globeopt.lat0;
lastlon = globeopt.lon0;
if (globeopt.firstclick === true) {
globeopt.startx = e.pageX - globeopt.offsetx;
globeopt.starty = e.pageY - globeopt.offsety;
latstart = globeopt.lat0;
lonstart = globeopt.lon0;
globeopt.firstclick = false;
}
var relx = e.pageX - globeopt.offsetx - globeopt.startx;
var rely = e.pageY - globeopt.offsety - globeopt.starty;
//$('#status').html(relx +', '+ rely);
globeopt.deltalon = (-relx / 4);
globeopt.deltalat = (rely / 4);
globeopt.lon0 = (lonstart + globeopt.deltalon + 540) % 360 - 180;
globeopt.lat0 = latstart + globeopt.deltalat;
if (globeopt.lat0 > 90) {globeopt.lat0 = 90; }
if (globeopt.lat0 < -90) {globeopt.lat0 = -90; }
//$('#relxystatus').html(globeopt.deltalat +'°'+ globeopt.deltalon + '°');
$('#latlonstatus').html((Math.floor(globeopt.lat0)) + '°, ' + (Math.floor(globeopt.lon0)) + '°');
if (globeopt.lat0 !== lastlat || globeopt.lon0 !== lastlon) {
renderFrame();
}
}
});

}); });
}); });
</script> </script>
Expand Down
3 changes: 2 additions & 1 deletion source/__init__.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -21,9 +21,10 @@
</div> </div>
<div class='code'> <div class='code'>
<div class="highlight"><pre><span class="kn">from</span> <span class="nn">kartograph</span> <span class="kn">import</span> <span class="n">Kartograph</span> <div class="highlight"><pre><span class="kn">from</span> <span class="nn">kartograph</span> <span class="kn">import</span> <span class="n">Kartograph</span>
<span class="kn">from</span> <span class="nn">kartograph</span> <span class="kn">import</span> <span class="n">verbose</span>
<span class="kn">from</span> <span class="nn">map</span> <span class="kn">import</span> <span class="n">projections</span> <span class="kn">from</span> <span class="nn">map</span> <span class="kn">import</span> <span class="n">projections</span>


<span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Kartograph&#39;</span><span class="p">,</span> <span class="s">&#39;projections&#39;</span><span class="p">]</span> <span class="n">__all__</span> <span class="o">=</span> <span class="p">[</span><span class="s">&#39;Kartograph&#39;</span><span class="p">,</span> <span class="s">&#39;projections&#39;</span><span class="p">,</span> <span class="s">&#39;verbose&#39;</span><span class="p">]</span>


</pre></div> </pre></div>
</div> </div>
Expand Down
4 changes: 3 additions & 1 deletion source/layersource/shplayer.html
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
<div class='code'> <div class='code'>
<div class="highlight"><pre><span class="kn">from</span> <span class="nn">layersource</span> <span class="kn">import</span> <span class="n">LayerSource</span> <div class="highlight"><pre><span class="kn">from</span> <span class="nn">layersource</span> <span class="kn">import</span> <span class="n">LayerSource</span>
<span class="kn">from</span> <span class="nn">kartograph.errors</span> <span class="kn">import</span> <span class="o">*</span> <span class="kn">from</span> <span class="nn">kartograph.errors</span> <span class="kn">import</span> <span class="o">*</span>
<span class="kn">from</span> <span class="nn">kartograph.geometry</span> <span class="kn">import</span> <span class="n">BBox</span><span class="p">,</span> <span class="n">create_feature</span></pre></div> <span class="kn">from</span> <span class="nn">kartograph.geometry</span> <span class="kn">import</span> <span class="n">BBox</span><span class="p">,</span> <span class="n">create_feature</span>

<span class="n">verbose</span> <span class="o">=</span> <span class="bp">True</span></pre></div>
</div> </div>
</div> </div>
<div class='clearall'></div> <div class='clearall'></div>
Expand Down
Loading

0 comments on commit dc406a0

Please sign in to comment.