本文整理汇总了Python中django.contrib.gis.maps.google.overlays.GEvent方法的典型用法代码示例。如果您正苦于以下问题:Python overlays.GEvent方法的具体用法?Python overlays.GEvent怎么用?Python overlays.GEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类django.contrib.gis.maps.google.overlays
的用法示例。
在下文中一共展示了overlays.GEvent方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from django.contrib.gis.maps.google import overlays [as 别名]
# 或者: from django.contrib.gis.maps.google.overlays import GEvent [as 别名]
def __init__(self, event, action):
"""
Initializes a GEvent object.
Parameters:
event:
string for the event, such as 'click'. The event must be a valid
event for the object in the Google Maps API.
There is no validation of the event type within Django.
action:
string containing a Javascript function, such as
'function() { location.href = "newurl";}'
The string must be a valid Javascript function. Again there is no
validation fo the function within Django.
"""
self.event = event
self.action = action
示例2: __str__
# 需要导入模块: from django.contrib.gis.maps.google import overlays [as 别名]
# 或者: from django.contrib.gis.maps.google.overlays import GEvent [as 别名]
def __str__(self):
"Returns the parameter part of a GEvent."
return '"%s", %s' % (self.event, self.action)
示例3: add_event
# 需要导入模块: from django.contrib.gis.maps.google import overlays [as 别名]
# 或者: from django.contrib.gis.maps.google.overlays import GEvent [as 别名]
def add_event(self, event):
"Attaches a GEvent to the overlay object."
self.events.append(event)