Rakefile in smappy-0.0.2 vs Rakefile in smappy-0.0.3
- old
+ new
@@ -1,10 +1,12 @@
require 'bundler'
Bundler.setup
Bundler.require
+Bundler::GemHelper.install_tasks
+
$LOAD_PATH.unshift File.expand_path("../lib", __FILE__)
require 'smappy'
namespace :smappy do
desc "Generate an example static map"
@@ -20,17 +22,15 @@
map.tile_url_template = 'http://a.tile.cloudmade.com/ed3b3505052b442dba7baff14f1ad671/47664/256/%{zoomlevel}/%{x}/%{y}.png'
# Google Maps tiles:
# map.tile_url_template = 'http://mt1.google.com/vt/x=%{x}&y=%{y}&z=%{zoomlevel}'
- canvas = map.to_image
- drawing = Magick::Draw.new
+ image = map.to_image
marker = Smappy::Marker.new(map.center.latitude, map.center.longitude)
position = marker.position_on_map(map)
-
- drawing.composite(position[0], position[1], marker.width, marker.height, marker.marker_image)
- drawing.draw(canvas)
-
- canvas.write 'tmp/map.png'
+
+ image.compose!(marker.marker_image, position[0], position[1])
+
+ image.save 'tmp/map.png'
end
end
\ No newline at end of file