本文整理匯總了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)