Skip to content

Commit 195edf2

Browse files
author
=
committed
client fixes and updates, changelog, sample data, notes, etc
1 parent 5694e38 commit 195edf2

22 files changed

+539
-52
lines changed

.line_data.dat

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

CHANGELOG

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
Cartagen: A Framework for Dynamic Mapping (Client Edition)
2+
3+
Version 0.6.2
4+
Released 10/12/09
5+
6+
CHANGES IN 0.6.2
7+
----------------
8+
9+
- Implemented native JSON parsing for browsers that support it
10+
11+
- Better viewport calculation
12+
13+
- Automatically prompt to empty localStorage when overfilled (slows down geohash loading due to overloading sqLite implementation of localStorage)
14+
15+
- Mobile app fixes
16+
17+
- Added new logo
18+
19+
CHANGES IN 0.6.1
20+
----------------
21+
22+
- Zooming works in iframes
23+
24+
- Don't break keyboard controls -- allow browser to handle keyboard events after Cartagen
25+
26+
- Move code around to improve API, including isolating Coastline code, moving things out
27+
of the Cartagen namespace, and separating data access API (now in the Data namespace) from the
28+
Geohash namespace.
29+
30+
- Loading indicator works with rotation
31+
32+
CHANGES IN 0.6
33+
--------------
34+
35+
- Improve interface responsiveness and control CPU usage with new TaskManager
36+
and TimerManager tools
37+
38+
- New configuration that allows configuration from both Cartagen.setup and GET
39+
parameters
40+
41+
- Simplify setting starting location -- replace lon1 and lon2 with a single lon
42+
parameter, same for lng1 and lng2
43+
44+
- Loading notification while features are parsed
45+
46+
- GSS-customizable context menus
47+
48+
- Debug styles that are only used in debug mode
49+
50+
CHANGES IN 0.5.1
51+
----------------
52+
53+
- Fixed feature sorting
54+
55+
- Much improved coastline support
56+
57+
- GSS image support
58+
59+
60+
CHANGES IN 0.5
61+
--------------
62+
63+
- First official release of Cartagen!
64+
65+
- Basic features are in place: loading OSM JSON from files and displaying nodes
66+
and ways
67+
68+
- First version of GSS fully in place and usable for styling maps, including
69+
dynamic styles and updating styles
70+
71+
- Some coastline detection
72+
73+
- Geohash spacial indexing system in place to efficiently select manipulate
74+
large quantities of geospatial data
75+
76+
- Search by tag or name
77+
78+
- Projection via Spherical Mercator
79+
80+
- Location detection via browser-based geolocation
81+
82+
- LocalStorage cache for browsers that support it
83+
84+
- Label support with automatic rotation to follow ways
85+
86+
- Native CanvasText for browsers that support it, manual text drawing for other
87+
browsers
88+

NOTES

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
Cartagen: A Framework for Dynamic Mapping (Client Edition)
2+
3+
Version 0.6.2
4+
Released 10/12/09
5+
6+
Please note that this is a beta release. There are know bugs and missing
7+
features. It is not intended for production systems.
8+
9+
CHANGES
10+
11+
- Implemented native JSON parsing for browsers that support it
12+
13+
- Better viewport calculation
14+
15+
- Automatically prompt to empty localStorage when overfilled (slows down geohash loading due to overloading sqLite implementation of localStorage)
16+
17+
- Mobile app fixes
18+
19+
- Added new logo
20+
21+
KNOWN BUGS
22+
23+
- Automatic label rotation sometimes does not work properly. Investigation of
24+
this issue is ongoing.
25+
26+
- Key commands such as refreshing the page don't work while the mouse if over the map area.
27+
28+
INCOMPATIBILITIES
29+
30+
The lat1, lat2, lng1, and lng2 parameters that were used in Cartagen.setup in
31+
the 0.5.x series are no longer used. They have been replaced by simply “lat”
32+
and “lng”. Please update your setup calls accordingly.
33+
34+
CONTRIBUTORS
35+
36+
Cartagen is developed at the MIT Media Lab in Cambridge, MA, USA by Jeffrey
37+
Warren and Ben Weissmann. <http://wiki.cartagen.org/> has up-to-date
38+
information and resources on how to contribute to the project.
39+
40+
MORE INFORMATION
41+
42+
<http://wiki.cartagen.org/> is the best source of information on Cartagen.

cartagen.js

Lines changed: 26 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -6744,7 +6744,6 @@ var Glop = {
67446744
resize: function(custom_size) {
67456745
if (!custom_size) { // see Canvas.to_print_data_url()
67466746
Glop.changed_size = (Glop.width != document.viewport.getWidth() || Glop.height != document.viewport.getHeight()-Config.padding_top)
6747-
$l(Glop.changed_size)
67486747
Glop.width = document.viewport.getWidth()
67496748
Glop.height = document.viewport.getHeight()-Config.padding_top
67506749
}
@@ -6775,7 +6774,7 @@ var Glop = {
67756774
Glop.frame += 1
67766775
} else {
67776776
Glop.times = []
6778-
} //else $l('powersave: '+this.tail)
6777+
}
67796778
Glop.date = new Date
67806779
}
67816780
}
@@ -7571,6 +7570,9 @@ var Keyboard = {
75717570
"x": function() {
75727571
localStorage.clear()
75737572
},
7573+
"m": function() {
7574+
Tool.change("Mask")
7575+
},
75747576
"r": function() {
75757577
Tool.unpress(['warp_distort'])
75767578
$('tool_warp_rotate').addClassName('down')
@@ -8417,6 +8419,7 @@ Tool.Warp = {
84178419
Tool.add_tool_specific_button("warp_undo",function(){Warper.active_image.undo();},"Undo last image edit","/images/silk-grey/arrow_undo.png","silk last")
84188420
$('tool_warp_distort').addClassName('down')
84198421
},
8422+
84208423
deactivate: function() {
84218424
Tool.remove_toolbar("tool_specific")
84228425
Tool.Warp.mode = 'default'
@@ -8476,13 +8479,14 @@ Tool.Mask = {
84768479
mode: 'draw', //'draw','inactive','drag'
84778480
current_poly: null,
84788481
drag: function() {
8479-
$l('Mask dragging')
84808482
},
84818483
activate: function() {
84828484
Tool.hide_tooltip()
8485+
Tool.add_toolbar("tool_specific")
8486+
Tool.add_tool_specific_button("mask_lock",Tool.Mask.mask_lock,"Lock this image with its mask","/images/silk-grey/lock.png","first silk")
84838487
},
84848488
deactivate: function() {
8485-
$l('Mask deactivated')
8489+
Tool.remove_toolbar("tool_specific")
84868490
},
84878491

84888492
mousedown: function() {
@@ -8503,10 +8507,8 @@ Tool.Mask = {
85038507
}.bindAsEventListener(Tool.Mask),
85048508

85058509
mouseup: function() {
8506-
$l('Mask mouseup')
85078510
}.bindAsEventListener(Tool.Mask),
85088511
mousemove: function() {
8509-
$l('Mask mousemove')
85108512
}.bindAsEventListener(Tool.Mask),
85118513

85128514
dblclick: function() {
@@ -8520,15 +8522,6 @@ Tool.Mask = {
85208522
Tool.Mask.mode='draw'
85218523
Tool.Mask.warpable.mask = new Tool.Mask.Shape([],Tool.Mask.warpable)
85228524
},
8523-
coordinates: function() {
8524-
coordinates = []
8525-
this.points.each(function(point) {
8526-
var lon = Projection.x_to_lon(-point.x)
8527-
var lat = Projection.y_to_lat(point.y)
8528-
coordinates.push([lon,lat])
8529-
})
8530-
return coordinates
8531-
},
85328525

85338526
Shape: Class.create({
85348527
initialize: function(nodes,parent_image) {
@@ -8542,8 +8535,17 @@ Tool.Mask = {
85428535
Glop.observe('mousedown', this.mousedown.bindAsEventListener(this))
85438536
Glop.observe('mouseup', this.mouseup.bindAsEventListener(this))
85448537
},
8538+
coordinates: function() {
8539+
coordinates = []
8540+
this.points.each(function(point) {
8541+
var lon = Projection.x_to_lon(-point.x)
8542+
var lat = Projection.y_to_lat(point.y)
8543+
coordinates.push([lon,lat])
8544+
})
8545+
return coordinates
8546+
},
85458547
new_point: function(x,y) {
8546-
this.points.push(new Tool.Mask.ControlPoint(x, y, 6/Map.zoom, this))
8548+
this.points.push(new Tool.Mask.ControlPoint(x, y, 6, this))
85478549
},
85488550
mouse_inside: function(){
85498551
return Geometry.is_point_in_poly(this.points, Map.pointer_x(), Map.pointer_y())
@@ -8617,13 +8619,12 @@ Tool.Mask = {
86178619
if (this.active) $C.line_width(2/Map.zoom)
86188620
else $C.line_width(0)
86198621
$C.begin_path()
8620-
if (this.points.length>0){
8622+
if (this.points.length > 0) {
86218623
$C.move_to(this.points[0].x, this.points[0].y)
86228624
this.points.each(function(point) {
86238625
$C.line_to(point.x, point.y)
86248626
})
86258627
$C.line_to(this.points[0].x, this.points[0].y)
8626-
86278628
}
86288629
$C.opacity(0.4)
86298630
$C.stroke()
@@ -8646,7 +8647,7 @@ Tool.Mask = {
86468647
draw: function() {
86478648
if (this.parent_shape.parent_image.active) {
86488649
$C.save()
8649-
$C.line_width(2/Map.zoom)
8650+
$C.line_width(3/Map.zoom)
86508651
$C.translate(this.x,this.y)
86518652
$C.fill_style("#333")
86528653
$C.opacity(0.6)
@@ -8658,11 +8659,10 @@ Tool.Mask = {
86588659
$C.line_to(6/Map.zoom,-6/Map.zoom)
86598660
$C.stroke()
86608661
} else {
8661-
if (this.mouse_inside()) $C.circ(0, 0, this.r)
8662-
$C.stroke_circ(0, 0, 6)//this.r)
8662+
if (this.mouse_inside()) $C.circ(0, 0, this.r/Map.zoom)
8663+
$C.stroke_circ(0, 0, this.r/Map.zoom)
86638664
}
86648665
$C.restore()
8665-
86668666
}
86678667

86688668
/*var nodestring = ''
@@ -8672,16 +8672,13 @@ Tool.Mask = {
86728672

86738673
if (this.dragging && Mouse.down) {
86748674
this.drag()
8675-
}
8676-
else if (this.mouse_inside()) {
8675+
} else if (this.mouse_inside()) {
86778676
if (Mouse.down) {
86788677
this.drag()
8679-
}
8680-
else {
8678+
} else {
86818679
this.hover()
86828680
}
8683-
}
8684-
else {
8681+
} else {
86858682
this.base()
86868683
}
86878684
},
@@ -8824,7 +8821,7 @@ var Interface = {
88248821

88258822
display_loading_message: function(percent) {
88268823
if (Config.vectors) {
8827-
$$('body')[0].insert('<div onClick="$(\'loading_message\').hide();" id="loading_message" style="position:absolute;z-index:20;top:25%;width:100%;text-align:center;-webkit-user-select:none;-moz-user-select:none;"><div style="width:200px;margin:auto;background:rgba(255,255,255,0.8);font-family:Lucida Grande,Lucida Sans Console,Georgia,sans-serif;font-size:16px;padding:14px;-moz-border-radius:10px;-webkit-border-radius:10px;"><p><img src="/images/spinner.gif" style="margin-bottom:12px;" /><br />Loading map data...<p><small>(Use arrow keys and +/- to pan and zoom)</small></p></div></div>')
8824+
$$('body')[0].insert('<div onClick="$(\'loading_message\').hide();" id="loading_message" style="position:absolute;z-index:20;top:25%;width:100%;text-align:center;-webkit-user-select:none;-moz-user-select:none;"><div style="width:200px;margin:auto;background:rgba(255,255,255,0.8);font-family:Lucida Grande,Lucida Sans Console,Georgia,sans-serif;font-size:16px;padding:14px;-moz-border-radius:10px;-webkit-border-radius:10px;"><p><img src="images/spinner.gif" style="margin-bottom:12px;" /><br />Loading map data...<p><small>(Use arrow keys and +/- to pan and zoom)</small></p></div></div>')
88288825
}
88298826
},
88308827

@@ -9936,10 +9933,6 @@ Warper.Image = Class.create(
99369933
var padv = pady * dv;
99379934

99389935

9939-
$l($H({
9940-
'dx, dy': Warper.p([dx, dy]),
9941-
'px, py': Warper.p([padx, pady])
9942-
}))
99439936

99449937
if (this.image.width) {
99459938
$C.canvas.drawImage(

images/cartagen.png

10.8 KB
Loading

images/spinner.gif

3.13 KB
Loading

0 commit comments

Comments
 (0)