Added marker icon to map
This commit is contained in:
@@ -49,10 +49,13 @@ module Wince
|
||||
DETAILS_MAP.map_source = Shumate::MapSourceRegistry
|
||||
.new_with_defaults().by_id(Shumate::MAP_SOURCE_OSM_MAPNIK)
|
||||
|
||||
icon = Gtk::Image.new_from_icon_name("view-pin-symbolic")
|
||||
pixbuf = GdkPixbuf::Pixbuf.new_from_resource("/wince/img/marker-icon.png")
|
||||
icon = Gtk::Image.new_from_pixbuf(pixbuf)
|
||||
@@marker = Shumate::Marker.new
|
||||
|
||||
@@marker.try do|m|
|
||||
m.height_request = 64
|
||||
m.width_request = 64
|
||||
m.child = icon
|
||||
marker_layer = Shumate::MarkerLayer.new(DETAILS_MAP.viewport)
|
||||
marker_layer.add_marker(m)
|
||||
@@ -174,7 +177,7 @@ module Wince
|
||||
|
||||
viewport = DETAILS_MAP.viewport
|
||||
viewport.set_location(latitude, longitude)
|
||||
viewport.zoom_level = 14
|
||||
viewport.zoom_level = 16
|
||||
|
||||
@@marker.try {|m| m.set_location(latitude, longitude) }
|
||||
end
|
||||
|
||||
@@ -29,5 +29,5 @@ module Wince
|
||||
DETAILS_HOURS_BOX = Gtk::ListBox.cast(B_UI["detailsHoursBox"])
|
||||
DETAILS_MAP = Shumate::SimpleMap.cast(B_UI["detailsMap"])
|
||||
|
||||
APP = Adw::Application.new("dev.wince", Gio::ApplicationFlags::None)
|
||||
APP = Adw::Application.new("space.quietfeathers.wince", Gio::ApplicationFlags::None)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user