Skip to content

Commit

Permalink
MapMarker: add source property for custom images
Browse files Browse the repository at this point in the history
  • Loading branch information
tito committed Jan 13, 2015
1 parent fe2881e commit 1beab69
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions mapview/view.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
from kivy.uix.scatter import Scatter
from kivy.uix.behaviors import ButtonBehavior
from kivy.properties import NumericProperty, ObjectProperty, ListProperty, \
AliasProperty, BooleanProperty
AliasProperty, BooleanProperty, StringProperty
from kivy.graphics import Canvas, Color, Rectangle
from kivy.graphics.transformation import Matrix
from kivy.lang import Builder
Expand All @@ -25,7 +25,7 @@
Builder.load_string("""
<MapMarker>:
size_hint: None, None
source: root.default_marker_fn
source: root.source
size: list(map(dp, self.texture_size))
allow_stretch: True
Expand Down Expand Up @@ -116,9 +116,9 @@ class MapMarker(ButtonBehavior, Image):
"""Longitude of the marker
"""

@property
def default_marker_fn(self):
return join(dirname(__file__), "icons", "marker.png")
source = StringProperty(join(dirname(__file__), "icons", "marker.png"))
"""Source of the marker, defaults to our own marker.png
"""


class MapMarkerPopup(MapMarker):
Expand Down

0 comments on commit 1beab69

Please sign in to comment.