Is this for the issue maps that Frank talked about for TFP portals? If so, I imagined a solution that was lighter weight. Storing each point as a post in Wordpress is quite heavy. Frank mentioned to me that he didn't think points would need any content, just a lat/lon, date and issue type. So there is probably an easier way to do this that wouldn't suffer from performance issues that you might see if you use post types.
---------- Forwarded message ----------
From:
Andrew Cochran <acoc...@openplans.org>
Date: Fri, Sep 9, 2011 at 6:31 PM
Subject: PlanningPress
To: Chris Abraham <
cabr...@openplans.org>, Frank Hebbert <
fr...@openplans.org>
Chris, when you have a moment, I'd like to go over my plan for how to
do adding points to maps. Here's my sketch…
CUSTOM POST TYPE
register_post_type 'mappoint'
add_post_meta 'latitude', 'longitude'
TAXONOMY
• register_taxonomy 'pointtype'
• insert extra fields in taxonomy edit form
- add_post_meta 'color', 'icon' (sets how the 'pointtype' looks on front end)
- HOW TO:
http://www.codehooligans.com/2010/07/07/custom-meta-for-new-taxonomies-in-wordpress-3-0/
MAP TEMPLATE ADMIN
• add_post_meta 'zoomlevel','latitude', 'longitude' (for default pan/zoom)
• add_post_meta 'droppable' (can users drop pins on map? regardless,
admins can on back end.)
• associate 'pointtype' taxonomy terms with post
MAP TEMPLATE (front-end)
• get list of 'pointtype' taxonomy terms associated w/ post
• loop through all CPT 'mappoint' posts w/ those terms, for each:
- get_post_meta 'latitude' & 'longitude'
- put a marker on the map
- bind the_content to the marker's popup
• if post_meta 'droppable' = true
- add 'pointtype' buttons to map UI for each associated term
- buttons trigger placement of draggable marker in center
- confirm button opens form for adding the_content
// doesn't require bikeshare.sql script
// optionally req WP's subscriber role (if !is_logged_in, 'pointtype'
buttons open registration form)