add_gmarker_entry.py
ATGoogleMapsへ携帯電話のGPS位置情報をエントリ - Plone script
Size 1 kB - File type text/python-sourceFile contents
# Parameters : entry_id,title,loc_a,loc_o,body
# Add object
new_id = context.invokeFactory(id=entry_id,type_name='GMarker')
ent = context[entry_id]
# Set body,title
ent.setTitle(title)
ent.setText(body)
# for ver.04 / Set Latitude,Longitude
# ent.setLatitude(loc_a)
# ent.setLongitude(loc_o)
# for ver.0.5 / Set Latitude,Longitude
latlng = {'latitude': loc_a, 'longitude': loc_o}
ent.setPoint(latlng)
# Index entry
ent.indexObject()
# Publish entry
ent.content_status_modify(workflow_action='publish')
Click here to get the file