lib/ProMotion/map/map_screen_annotation.rb in ProMotion-1.0.4 vs lib/ProMotion/map/map_screen_annotation.rb in ProMotion-1.1.0.rc1

- old
+ new

@@ -15,11 +15,11 @@ def set_defaults @params = { title: "Title", pin_color: MKPinAnnotationColorRed, - identifier: "Annotation-#{@params[:pin_color]}", + identifier: "Annotation-#{@params[:pin_color] || @params[:image]}", show_callout: true, animates_drop: false }.merge(@params) end @@ -48,9 +48,18 @@ end # Allows for retrieving your own custom values on the annotation def annotation_params @params + end + + def method_missing(meth, *args) + if @params[meth.to_sym] + @params[meth.to_sym] + else + PM.logger.warn "The annotation parameter \"#{meth}\" does not exist on this pin." + nil + end end end end