Bringing in Uptra's interactive maps.
--- /dev/null
+/*
+Author: L. Voogdt
+License: MIT
+Version: 1.0
+*/
+
+/* Marker setup */
+.awesome-marker {
+ background: url('images/markers-soft.png') no-repeat 0 0;
+ width: 35px;
+ height: 46px;
+ position:absolute;
+ left:0;
+ top:0;
+ display: block;
+ text-align: center;
+}
+
+.awesome-marker-shadow {
+ background: url('images/markers-shadow.png') no-repeat 0 0;
+ width: 36px;
+ height: 16px;
+}
+
+/* Retina displays */
+@media (min--moz-device-pixel-ratio: 1.5),(-o-min-device-pixel-ratio: 3/2),
+(-webkit-min-device-pixel-ratio: 1.5),(min-device-pixel-ratio: 1.5),(min-resolution: 1.5dppx) {
+ .awesome-marker {
+ background-image: url('images/markers-soft@2x.png');
+ background-size: 720px 46px;
+ }
+ .awesome-marker-shadow {
+ background-image: url('images/markers-shadow@2x.png');
+ background-size: 35px 16px;
+ }
+}
+
+.awesome-marker i {
+ color: #333;
+ margin-top: 10px;
+ display: inline-block;
+ font-size: 14px;
+}
+
+.awesome-marker .icon-white {
+ color: #fff;
+}
+
+/* Colors */
+.awesome-marker-icon-red {
+ background-position: 0 0;
+}
+
+.awesome-marker-icon-darkred {
+ background-position: -180px 0;
+}
+
+.awesome-marker-icon-lightred {
+ background-position: -360px 0;
+}
+
+.awesome-marker-icon-orange {
+ background-position: -36px 0;
+}
+
+.awesome-marker-icon-beige {
+ background-position: -396px 0;
+}
+
+.awesome-marker-icon-green {
+ background-position: -72px 0;
+}
+
+.awesome-marker-icon-darkgreen {
+ background-position: -252px 0;
+}
+
+.awesome-marker-icon-lightgreen {
+ background-position: -432px 0;
+}
+
+.awesome-marker-icon-blue {
+ background-position: -108px 0;
+}
+
+.awesome-marker-icon-darkblue {
+ background-position: -216px 0;
+}
+
+.awesome-marker-icon-lightblue {
+ background-position: -468px 0;
+}
+
+.awesome-marker-icon-purple {
+ background-position: -144px 0;
+}
+
+.awesome-marker-icon-darkpurple {
+ background-position: -288px 0;
+}
+
+.awesome-marker-icon-pink {
+ background-position: -504px 0;
+}
+
+.awesome-marker-icon-cadetblue {
+ background-position: -324px 0;
+}
+
+.awesome-marker-icon-white {
+ background-position: -574px 0;
+}
+
+.awesome-marker-icon-gray {
+ background-position: -648px 0;
+}
+
+.awesome-marker-icon-lightgray {
+ background-position: -612px 0;
+}
+
+.awesome-marker-icon-black {
+ background-position: -682px 0;
+}
--- /dev/null
+/*
+ Leaflet.AwesomeMarkers, a plugin that adds colorful iconic markers for Leaflet, based on the Font Awesome icons
+ (c) 2012-2013, Lennard Voogdt
+
+ http://leafletjs.com
+ https://github.com/lvoogdt
+*//*global L*/(function(e,t,n){"use strict";L.AwesomeMarkers={};L.AwesomeMarkers.version="2.0.1";L.AwesomeMarkers.Icon=L.Icon.extend({options:{iconSize:[35,45],iconAnchor:[17,42],popupAnchor:[1,-32],shadowAnchor:[10,12],shadowSize:[36,16],className:"awesome-marker",prefix:"glyphicon",spinClass:"fa-spin",icon:"home",markerColor:"blue",iconColor:"white"},initialize:function(e){e=L.Util.setOptions(this,e)},createIcon:function(){var e=t.createElement("div"),n=this.options;n.icon&&(e.innerHTML=this._createInner());n.bgPos&&(e.style.backgroundPosition=-n.bgPos.x+"px "+ -n.bgPos.y+"px");this._setIconStyles(e,"icon-"+n.markerColor);return e},_createInner:function(){var e,t="",n="",r="",i=this.options;i.icon.slice(0,i.prefix.length+1)===i.prefix+"-"?e=i.icon:e=i.prefix+"-"+i.icon;i.spin&&typeof i.spinClass=="string"&&(t=i.spinClass);i.iconColor&&(i.iconColor==="white"||i.iconColor==="black"?n="icon-"+i.iconColor:r="style='color: "+i.iconColor+"' ");return"<i "+r+"class='"+i.prefix+" "+e+" "+t+" "+n+"'></i>"},_setIconStyles:function(e,t){var n=this.options,r=L.point(n[t==="shadow"?"shadowSize":"iconSize"]),i;t==="shadow"?i=L.point(n.shadowAnchor||n.iconAnchor):i=L.point(n.iconAnchor);!i&&r&&(i=r.divideBy(2,!0));e.className="awesome-marker-"+t+" "+n.className;if(i){e.style.marginLeft=-i.x+"px";e.style.marginTop=-i.y+"px"}if(r){e.style.width=r.x+"px";e.style.height=r.y+"px"}},createShadow:function(){var e=t.createElement("div");this._setIconStyles(e,"shadow");return e}});L.AwesomeMarkers.icon=function(e){return new L.AwesomeMarkers.Icon(e)}})(this,document);
--- /dev/null
+var GlmMap = {
+ _map: null,
+ _latLngBounds: null,
+ _infoWindow: null,
+ _allMarkers: [],
+ // change speed 'slow' is 600 and 'fast' is 200
+ _catDivSpeed: 180,
+ _defZoom: 8,
+ leafletTileServer: 'https://maps.gaslightmedia.com/08172018-c1feaf327f962d6c7c98b52003d1fa82/' + '{z}/{x}/{y}.png',
+ leafletMinZoom: 3,
+ leafletMaxZoom: 19,
+ clusterRadiusMax: 40,
+ markerGroup: '',
+ markerAreaGroup: '',
+
+ init: function()
+ {
+ GlmMap.leafletMap = L.map('LeafletMapContainer').setView([46.225453, -87.011719], GlmMap._defZoom);
+ GlmMap.markerGroup = L.featureGroup({
+ maxClusterRadius: GlmMap.clusterRadiusMax
+ });
+ GlmMap.markerAreaGroup = L.featureGroup({
+ maxClusterRadius: GlmMap.clusterRadiusMax
+ });
+
+ // Loading features
+ var loadingControl = L.Control.loading({
+ separate: true,
+ delayIndicator: 500
+ });
+ GlmMap.leafletMap.addControl(loadingControl);
+
+ // Init Map
+ L.tileLayer(GlmMap.leafletTileServer, {
+ attribution: 'Map data © <a href="https://www.openstreetmap.org/">OpenStreetMap</a> contributors, <a href="https://creativecommons.org/licenses/by-sa/2.0/">CC-BY-SA</a>, Imagery © <a href="https://www.gaslightmedia.com/">Gaslight Media</a>',
+ minZoom: GlmMap.leafletMinZoom,
+ maxZoom: GlmMap.leafletMaxZoom,
+ id: 'nothot'
+ }).addTo(GlmMap.leafletMap);
+
+ jQuery.each(glm_memberCats, function(i, category_id){
+ // attach action to top of tab
+ jQuery("#cat-main-open-" + category_id).click(function(){
+ jQuery("#cat-main-" + category_id).slideToggle(GlmMap._catDivSpeed);
+ });
+ // attach action to bottom of tab
+ jQuery("#cat-main-close-" + category_id).click(function(){
+ jQuery("#cat-main-" + category_id).slideUp(GlmMap._catDivSpeed);
+ });
+ });
+ jQuery("#memLocHdr").click(function (){
+ GlmMap._showLocations();
+ });
+ jQuery("input[name^='category']").click(function (){
+ GlmMap._clearMarkers();
+ GlmMap._getCategoryValues();
+ GlmMap._setActiveCatDiv();
+ });
+ jQuery(".mapCity a").click(function (){
+ GlmMap._hideLocations();
+ var params = "?city_id=" + jQuery(this).attr('rel');
+ jQuery.get(glm_base_url + "member-city-google-map/" + params, GlmMap._centerCity, 'xml');
+ return false;
+ });
+ jQuery(".mapCounty a").click(function (){
+ GlmMap._hideLocations();
+ var params = "?region=" + jQuery(this).attr('rel');
+ jQuery.get(glm_base_url + "member-city-google-map/" + params, GlmMap._centerCounty, 'xml');
+ return false;
+ });
+ },
+
+ _showLocations: function(){
+ jQuery("#mapCities").show();
+ jQuery("#mapCounties").show();
+// jQuery("#memberLocations").slideToggle(GlmMap._catDivSpeed);
+ jQuery("#memberLocations").show();
+ jQuery("#memberLocations").animate({
+ left: '5',
+ height: '520',
+ width: '966',
+ duration: '1'
+ }, GlmMap._catDivSpeed, function(){
+ // done
+ });
+ },
+
+ _hideLocations: function(){
+
+ jQuery("#memberLocations").animate({
+ left: '980',
+ height: '0',
+ width: '0',
+ duration: '10'
+ }, GlmMap._catDivSpeed, function(){
+ jQuery("#mapCities").hide();
+ jQuery("#mapCounties").hide();
+ });
+ },
+
+ _getCategoryValues: function(){
+ var values = jQuery("#category-form").serialize();
+ // jQuery.get(glm_base_url + 'member-area-google-map/?' + values, GlmMap._loadData, 'xml');
+ jQuery.ajax({
+ url: glm_ajax_url + '?action=glm_members_admin_ajax&glm_action=membersMapData&' + values,
+ cache: false,
+ dataType: 'json',
+ success: function( mapData ){
+ console.log( 'mapData: ', mapData );
+ GlmMap._loadData( mapData )
+ }
+ });
+ },
+
+ _setActiveCatDiv: function() {
+ jQuery.each(glm_memberCats, function (i, category_id){
+ jQuery("#cat-" + category_id).removeClass('highlightBox');
+ var counter = jQuery("#cat-" + category_id).find("input:checked");
+ if (counter.length > 0) {
+ jQuery("#cat-" + category_id).addClass('highlightBox');
+ }
+ });
+ },
+
+ _clearMarkers: function(){
+ GlmMap.markerGroup.clearLayers();
+ },
+
+ _loadData: function(markers)
+ {
+ var colorMarker = '';
+ // var markers = data.documentElement.getElementsByTagName("marker");
+ for (i = 0; i < markers.length; i++) {
+ var name = markers[i].member_name;
+ var street = markers[i].addr1;
+ var city = markers[i].city;
+ var state = markers[i].state;
+ var zip = markers[i].zip;
+ var lat = markers[i].lat;
+ var lng = markers[i].lon;
+ var directions = '';//markers[i].;
+ var phone = markers[i].phone;
+ var clickThru = markers[i].url;
+ var website = markers[i].url;
+ var logoPath = '';//markers[i].;
+ var logo = '';//markers[i].getAttribute('logo');
+ var logoWidth = '';//markers[i].getAttribute('logoWidth');
+ var logoHeight = '';//markers[i].getAttribute('logoHeight');
+ var hasTripPlanner = '';//markers[i].getAttribute('hasTripPlanner');
+ var addToPlannerUrl = '';//markers[i].getAttribute('addToPlannerUrl');
+ var viewPlannerUrl = '';//markers[i].getAttribute('viewPlannerUrl');
+ var plannerText = '';//markers[i].getAttribute('plannerText');
+ var moreInfoUrl = '';//markers[i].getAttribute('moreInfoUrl');
+ var markerColor = markers[i].color;//getAttribute('iconUrl');
+
+ var html = '<table><tbody><tr>';
+ if (street == null) {
+ street = '';
+ }
+ if (city == null) {
+ city = '';
+ }
+ if (state == null) {
+ state = '';
+ }
+ if (zip == null) {
+ zip = '';
+ }
+ html += '<td><b>' + name + '</b><br>' +
+ street + '<br>' + city + ', ' + state + ' ' + zip;
+
+ if (phone != '' && phone != null) {
+ html += '<br>' + phone;
+ }
+ if (website != '' && website != null) {
+ html += '<br>' + '<a target="_blank" href="'+clickThru+'">Website</a>';
+ }
+
+ html += '</td>';
+ html += '</tr></tbody></table>';
+ if (moreInfoUrl) {
+ html += '<span class="infoWindow moreInfo"><a href="'+moreInfoUrl+'">More Info</a></span>';
+ html += '<span class="infoWindow divider"> - </span>';
+ }
+ if (addToPlannerUrl != '' && hasTripPlanner) {
+ html += '<span class="infoWindow addToPlanner">' +
+ '<a href="'+addToPlannerUrl+'">'+plannerText+'</a>' +
+ '<a style="display: none;" href="'+viewPlannerUrl+'">View Planner</a>' +
+ '</span>';
+ html += '<span class="infoWindow divider"> - </span>';
+ }
+
+ html += '<span class="infoWindow directions"><a target="_blank" href="https://maps.google.com/maps/search/?api=1&query='+directions+'">Get Directions</a></span>';
+
+ defaultMarker = L.AwesomeMarkers.icon({
+ prefix: 'fa',
+ icon: 'dot-circle',
+ markerColor: 'blue',
+ });
+
+ if ( markerColor ) {
+ colorMarker = L.AwesomeMarkers.icon({
+ prefix: 'fa',
+ icon: 'dot-circle',
+ markerColor: markerColor,
+ });
+ var leafletMarker = L.marker([lat, lng], { title: name, icon: colorMarker })
+ .bindPopup( html )
+ .addTo(GlmMap.markerGroup);
+ } else {
+ var leafletMarker = L.marker([lat, lng], { title: name, icon: defaultMarker })
+ .bindPopup( html )
+ .addTo(GlmMap.markerGroup);
+ }
+
+ }
+
+ GlmMap.leafletMap.addLayer(GlmMap.markerGroup);
+
+ // Get outer bounds of all markers in the Feature Group
+ GlmMap.leafletMap.fitBounds(GlmMap.markerGroup.getBounds());
+
+ // When a marker is clicked, display the pop-up near the center of the map.
+ GlmMap.leafletMap.on('popupopen', function(e) {
+ var px = GlmMap.leafletMap.project(e.popup._latlng);
+ px.y -= e.popup._container.clientHeight/2;
+ GlmMap.leafletMap.panTo(GlmMap.leafletMap.unproject(px),{ animate: true });
+ });
+ },
+
+ _loadCityData: function(data)
+ {
+ var markers = data.documentElement.getElementsByTagName("marker");
+ for (i = 0; i < markers.length; i++) {
+ var name = markers[i].getAttribute('city_name');
+ var lat = markers[i].getAttribute('lat');
+ var lng = markers[i].getAttribute('lng');
+
+ var point = new google.maps.LatLng(
+ parseFloat(lat),
+ parseFloat(lng)
+ );
+
+ var marker = new google.maps.Marker({
+ title: name,
+ map: GlmMap._map,
+ position: point
+ });
+
+ GlmMap._allMarkers.push(marker);
+ }
+
+ },
+
+ _centerCity: function(data) {
+ GlmMap.markerAreaGroup.clearLayers();
+ var markers = data.documentElement.getElementsByTagName("marker");
+ for (i = 0; i < markers.length; i++) {
+ var lat = markers[i].getAttribute('lat');
+ var lng = markers[i].getAttribute('lng');
+ var leafletMarker = L.marker([lat, lng], { title: name })
+ .addTo(GlmMap.markerAreaGroup);
+ }
+ GlmMap.leafletMap.fitBounds(GlmMap.markerAreaGroup.getBounds());
+ GlmMap.leafletMap.setZoom(13);
+ },
+
+ _centerCounty: function(data) {
+ GlmMap.markerAreaGroup.clearLayers();
+ var markers = data.documentElement.getElementsByTagName("marker");
+ for (i = 0; i < markers.length; i++) {
+ var lat = markers[i].getAttribute('lat');
+ var lng = markers[i].getAttribute('lng');
+ var leafletMarker = L.marker([lat, lng], { title: name })
+ .addTo(GlmMap.markerAreaGroup);
+ }
+ GlmMap.leafletMap.fitBounds(GlmMap.markerAreaGroup.getBounds());
+ },
+
+ _bindInfoWindow: function(marker, map, infoWindow, html)
+ {
+ google.maps.event.addListener(marker, 'click', function() {
+ infoWindow.setContent(html);
+ infoWindow.open(map, marker);
+
+ jQuery(".addToPlanner a:first").live('click', function() {
+ if (jQuery(this).text() == 'Add To Planner') {
+ jQuery.get(jQuery(this).attr('href'));
+ jQuery(".addToPlanner a:first").hide();
+ jQuery(".addToPlanner a:last").show();
+ return false;
+ }
+ });
+ });
+ }
+};
+
+jQuery(document).ready(GlmMap.init);
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * File Library - File Delete
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+// Load Members data abstract
+require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php';
+
+/*
+ * This class performs the work of handling images passed to it via
+ * an AJAX call that goes through the WorPress AJAX Handler.
+ *
+ */
+class GlmMembersAdmin_ajax_membersMapData extends GlmDataMemberInfo
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /*
+ * Constructor
+ *
+ * This contructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ // Run constructor for members data class
+ parent::__construct(false, false);
+
+ }
+
+ /*
+ * Perform Model Action
+ *
+ * This modelAction takes an AJAX image upload and stores the image in the
+ * media/images directory of the plugin.
+ *
+ * This model action does not return, it simply does it's work then calls die();
+ *
+ * @param $_REQUEST['id'] File Library ID
+ */
+ public function modelAction ( $actionData = false )
+ {
+ $jsonMemberData = array();
+
+ $colorArray = array(
+ 791 => 'red', // attractions
+ 792 => 'darkred', // dining
+ 793 => 'green', // Places to stay
+ 794 => 'cadetblue', // recreation
+ 795 => 'purple', // services
+ 796 => 'orange', // shopping
+ 797 => 'darkgreen', // transportation
+ );
+
+ trigger_error( print_r( $_REQUEST, true ), E_USER_NOTICE );
+
+ if ( isset( $_REQUEST['values'] ) ) {
+ trigger_error( print_r( $_REQUEST['values'], true ), E_USER_NOTICE );
+ }
+
+ $categories = $_REQUEST['category'];
+
+ if ( !$categories ) {
+ echo json_encode( $jsonMemberData );
+ exit;
+ }
+
+ $where = "T.id IN (
+ SELECT member_info
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info
+ WHERE category IN ( " . implode( ',', $categories ) . " )
+ )";
+
+ $jsonMemberData = $this->getSimpleMemberInfoList($where, true);
+
+ // Go through the member data and setup the marker colors depending on the category
+ foreach ( $jsonMemberData as $key => &$memberInfo ) {
+ $cats = $this->wpdb->get_results(
+ $this->wpdb->prepare(
+ "SELECT *
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "categories
+ WHERE id IN (
+ SELECT category
+ FROM " . GLM_MEMBERS_PLUGIN_DB_PREFIX . "category_member_info
+ WHERE member_info = %d ) ",
+ $memberInfo['id']
+ ),
+ ARRAY_A
+ );
+ if ( count( $cats ) > 1 || count( $cats ) == 0 ) {
+ $memberInfo['color'] = 'blue';
+ } else if ( count( $cats ) == 1 ) {
+ $memberInfo['color'] = $colorArray[$cats[0]['parent']];
+ }
+ }
+
+
+ header( 'Content-type: application/json' );
+ echo json_encode( $jsonMemberData );
+
+ exit;
+
+ }
+
+}
--- /dev/null
+<?php
+
+/**
+ * Gaslight Media Members Database
+ * Front Interactive Map
+ *
+ * PHP version 5.5
+ *
+ * @category glmWordPressPlugin
+ * @package glmMembersDatabase
+ * @author Chuck Scott <cscott@gaslightmedia.com>
+ * @license http://www.gaslightmedia.com Gaslightmedia
+ * @version 0.1
+ */
+
+
+// Load Members data abstract
+// require_once GLM_MEMBERS_PLUGIN_CLASS_PATH.'/data/dataMemberInfo.php';
+
+/*
+ * This class performs the work for the default action of the "Members" menu
+ * option, which is to display the members dashboard.
+ *
+ */
+class GlmMembersFront_members_interactivemap //extends GlmDataMemberInfo
+{
+
+ /**
+ * WordPress Database Object
+ *
+ * @var $wpdb
+ * @access public
+ */
+ public $wpdb;
+ /**
+ * Plugin Configuration Data
+ *
+ * @var $config
+ * @access public
+ */
+ public $config;
+
+ /*
+ * Constructor
+ *
+ * This contructor sets up this model. At this time that only includes
+ * storing away the WordPress data object.
+ *
+ * @return object Class object
+ *
+ */
+ public function __construct ($wpdb, $config)
+ {
+
+ // Save WordPress Database object
+ $this->wpdb = $wpdb;
+
+ // Save plugin configuration object
+ $this->config = $config;
+
+ // Run constructor for members data class
+ // parent::__construct(false, false);
+
+ }
+
+ /*
+ * Perform Model Action
+ *
+ * This method does the work for this model and returns any resulting data
+ *
+ * @return array Status and data array
+ *
+ * 'status'
+ *
+ * True if successful and false if there was a fatal failure.
+ *
+ * 'menuItemRedirect'
+ *
+ * If not false, provides a menu item the controller should
+ * execute after this one. Normally if this is used, there would also be a
+ * modelRedirect value supplied as well.
+ *
+ * 'modelRedirect'
+ *
+ * If not false, provides an action the controller should execute after
+ * this one.
+ *
+ * 'view'
+ *
+ * A suggested view name that the contoller should use instead of the
+ * default view for this model or false to indicate that the default view
+ * should be used.
+ *
+ * 'data'
+ *
+ * Data that the model is returning for use in merging with the view to
+ * produce output.
+ *
+ */
+ public function modelAction ( $actionData = false )
+ {
+ $settings = array();
+ $success = true;
+
+ // Need Member Categories (with active members)
+ // Need Cities (with active members)
+ // Need Regions (with active members)
+
+ $templateData = array(
+ 'jsUrl' => GLM_MEMBERS_PLUGIN_JS_URL,
+ 'categories' => $this->getMemberCategories(),
+
+ );
+ // echo '<pre>$categories: ' . print_r( $this->getMemberCategories(), true ) . '</pre>';
+
+ // Return status, suggested view, and data to controller - also return any modified settings
+ return array(
+ 'status' => $success,
+ 'menuItemRedirect' => false,
+ 'modelRedirect' => false,
+ 'view' => "front/members/interactivemap.html",
+ 'data' => $templateData,
+ 'settings' => $settings
+ );
+
+ }
+
+ public function getMemberCategories()
+ {
+ $categories = array(
+ 793 => array(
+ 'name' => 'Places To Stay',
+ 'subCats' => $this->getSubCategories( 793 ),
+ ),
+ 791 => array(
+ 'name' => 'Attractions',
+ 'subCats' => $this->getSubCategories( 791 ),
+ ),
+ 794 => array(
+ 'name' => 'Recreation',
+ 'subCats' => $this->getSubCategories( 794 ),
+ ),
+ 792 => array(
+ 'name' => 'Dining',
+ 'subCats' => $this->getSubCategories( 792 ),
+ ),
+ 796 => array(
+ 'name' => 'Shopping',
+ 'subCats' => $this->getSubCategories( 796 ),
+ ),
+ 795 => array(
+ 'name' => 'Services',
+ 'subCats' => $this->getSubCategories( 795 ),
+ ),
+ 797 => array(
+ 'name' => 'Transportation',
+ 'subCats' => $this->getSubCategories( 797 ),
+ ),
+ );
+ return $categories;
+ }
+
+ public function getSubCategories( $id )
+ {
+ $categories = array();
+ require_once GLM_MEMBERS_PLUGIN_CLASS_PATH . '/data/dataCategories.php';
+ $Categories = new GlmDataCategories( $this->wpdb, $this->config );
+
+ $where = " T.parent = $id ";
+ $order = " T.parent, T.name ";
+ $categories = $Categories->getList( $where, $order );
+
+
+ return $categories;
+ }
+
+ public function getRegions()
+ {
+ }
+
+ public function getCities()
+ {
+ }
+
+
+}
'attributes' => array (
'number' => 1
)
- )
+ ),
+ 'glm-member-interactive-map' => array(
+ 'plugin' => GLM_MEMBERS_PLUGIN_SLUG,
+ 'menu' => 'members',
+ 'action' => 'interactivemap',
+ 'table' => false,
+ 'attributes' => array(
+ 'client' => 'uptra',
+ ),
+ ),
);
$glmMembersShortcodes = apply_filters( 'glm-custom-fields-shortcodes', $glmMembersShortcodes );
$glmMembersValidActions = array(
'adminActions' => array(
'ajax' => array(
- 'imageUpload' => 'glm-member-db',
- 'fileUpload' => 'glm-member-db',
- 'newOldMemberIdsCsv' => 'glm-member-db',
- 'membersListExport' => 'glm-member-db',
- 'memberClickThrough' => 'glm-member-db',
- 'memberDetailClick' => 'glm-member-db',
- 'memberGraphs' => 'glm-member-db',
- 'fileLibraryUpload' => 'glm-member-db',
- 'fileLibraryDownload' => 'glm-member-db',
- 'fileLibraryDelete' => 'glm-member-db',
- 'fileLibraryUpdate' => 'glm-member-db',
- 'glmCron' => 'glm-member-db'
+ 'imageUpload' => 'glm-member-db',
+ 'fileUpload' => 'glm-member-db',
+ 'newOldMemberIdsCsv' => 'glm-member-db',
+ 'membersListExport' => 'glm-member-db',
+ 'memberClickThrough' => 'glm-member-db',
+ 'memberDetailClick' => 'glm-member-db',
+ 'memberGraphs' => 'glm-member-db',
+ 'fileLibraryUpload' => 'glm-member-db',
+ 'fileLibraryDownload' => 'glm-member-db',
+ 'fileLibraryDelete' => 'glm-member-db',
+ 'fileLibraryUpdate' => 'glm-member-db',
+ 'glmCron' => 'glm-member-db',
+ 'membersMapData' => 'glm-member-db',
),
'dashboard' => array(
'index' => 'glm-member-db',
- 'members' => 'glm-member-db'
+ 'members' => 'glm-member-db',
),
'dashboardWidget' => array(
- 'index' => 'glm-member-db'
+ 'index' => 'glm-member-db',
),
'fileLibrary' => array(
- 'index' => 'glm-member-db'
+ 'index' => 'glm-member-db',
),
'members' => array(
'index' => 'glm-member-db', // member list
'list' => 'glm-member-db',
'reports' => 'glm-member-db',
- 'other' => 'glm-member-db'
+ 'other' => 'glm-member-db',
),
'member' => array(
'index' => 'glm-member-db', // Member Dashboard
'memberInfo' => 'glm-member-db',
'memberEdit' => 'glm-member-db',
- 'locations' => 'glm-member-db'
+ 'locations' => 'glm-member-db',
),
'settings' => array(
'index' => 'glm-member-db', // Member Types
'cities' => 'glm-member-db',
'regions' => 'glm-member-db',
'counties' => 'glm-member-db',
- 'amenities' => 'glm-member-db'
+ 'amenities' => 'glm-member-db',
),
'management' => array(
'index' => 'glm-member-db', // General Options
'import' => 'glm-member-db',
'addons' => 'glm-member-db',
'hooks' => 'glm-member-db',
- 'cron' => 'glm-member-db'
+ 'cron' => 'glm-member-db',
),
'shortcodes' => array(
- 'index' => 'glm-member-db'
+ 'index' => 'glm-member-db',
),
'error' => array(
'index' => 'glm-member-db',
- 'badAction' => 'glm-member-db'
+ 'badAction' => 'glm-member-db',
),
'pages' => array(
- 'shortcode' => 'glm-member-db'
+ 'shortcode' => 'glm-member-db',
),
'import' => array(
- 'index' => 'glm-member-db'
+ 'index' => 'glm-member-db',
)
),
'frontActions' => array(
'members' => array(
- 'list' => 'glm-member-db',
- 'detail' => 'glm-member-db',
- 'featured' => 'glm-member-db'
+ 'list' => 'glm-member-db',
+ 'detail' => 'glm-member-db',
+ 'featured' => 'glm-member-db',
+ 'interactivemap' => 'glm-member-db',
),
'error' => array(
'index' => 'glm-member-db',
- 'badAction' => 'glm-member-db'
+ 'badAction' => 'glm-member-db',
)
),
);
--- /dev/null
+{literal}
+<style>
+ #category {display: none;}
+ .listing {display: none;}
+ #inside #maincol {width: 100%;}
+ #inside #leftcol, #inside #action2 {display: none;}
+ /* Waether Stuff */
+.weatherBlock {
+ overflow: hidden;
+ width: 275px;
+ float: left;
+ margin-bottom: 5px;
+ margin-top: 10px;
+ }
+.weatherIn {
+ margin: 6px 0 6px 6px;
+ height: 1%;
+ overflow: hidden;
+ border: 1px solid #CBCBAA;
+ background: url({/literal}{$assetsUrl}{literal}/bg-form.jpg);
+ }
+#memberCategoryBox {
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ }
+.categoryBox {
+ display: block;
+ float: left;
+ border: 0px solid #f0f0f0;
+ width: 14.30%;
+ width: 137px;
+ list-style-type: none;
+ margin: 0;
+ padding: 0;
+ position: relative;
+ }
+.catName {
+ background: url({/literal}{$assetsUrl}{literal}/bg_body.jpg) no-repeat 0 -50px;
+ padding: 10px 5px;
+ display: block;
+ -webkit-border-top-left-radius: 10px;
+ -webkit-border-top-right-radius: 10px;
+ -moz-border-radius-topleft: 10px;
+ -moz-border-radius-topright: 10px;
+ border-top-left-radius: 10px;
+ border-top-right-radius: 10px;
+ border: 1px solid #ccc;
+ cursor: hand;
+ cursor: pointer;
+ font-weight: bold;
+ color: white;
+ }
+.catName i {
+ display: block;
+ background: url({/literal}{$assetsUrl}{literal}/bullet_arrow_downOn.png) no-repeat right center;
+ font-style: normal;
+ }
+.highlightBox #cat-main-open-791 { /* ATTRACTIONS */
+ background: #E52222;
+ }
+.highlightBox #cat-main-open-793 { /* PLACES TO STAY */
+ background: #258E25;
+ }
+.highlightBox #cat-main-open-794 { /* RECREATION */
+ background: #2C2CE0;
+ }
+.highlightBox #cat-main-open-792 { /* DINING */
+ background: #FFFF7A;
+ color: black;
+ }
+.highlightBox #cat-main-open-796 { /* SHOPPING */
+ background: #ED8115;
+ }
+.highlightBox #cat-main-open-795 { /* SERVICES */
+ background: #932493;
+ }
+.highlightBox #cat-main-open-797 { /* TRANSPORTATION */
+ background: #8E3B3B;
+ }
+
+.catName:hover {
+ color: white;
+ background-position: 0 -130px;
+ }
+.catName i:hover {
+ background: url({/literal}{$assetsUrl}{literal}/bullet_arrow_down.png) no-repeat right center;
+ }
+.categoryBox+div{
+ position: absolute;
+ z-index: 100;
+ }
+ div.highlightBox {
+ background-color: yellow;
+ display: block;
+ float: left;
+ border: 1px solid #f0f0f0;
+ }
+ /* DROPDOWN */
+div.showHideDiv {
+ display: none;
+ background: white;
+ cursor: hand;
+ cursor: pointer;
+ border: 1px solid #ccc;
+ z-index: 5;
+ position: relative;
+ max-height: 460px;
+ overflow: auto;
+ }
+div.showHideDiv label {
+ cursor: hand;
+ cursor: pointer;
+ }
+/* MAP */
+.mapShortcut {
+ position: absolute;
+ top: 80px;
+ right: 100px;
+ margin: 5px;
+ line-height: 160%;
+ padding: 0 20px 0 6px;
+ border-radius: 2px 2px;
+ -webkit-box-shadow: rgba(0, 0, 0, 0.347656) 2px 2px 3px;
+ box-shadow: rgba(0, 0, 0, 0.347656) 2px 2px 3px;
+ border: 1px solid #A9BBDF;
+ font-weight: bold;
+ background-color: #FEFEFE;
+ background-image: -moz-linear-gradient(top, #FEFEFE, #9ad097); /* FF3.6 */
+ background-image: -ms-linear-gradient(top, #FEFEFE, #9ad097); /* IE10 */
+ background-image: -o-linear-gradient(top, #FEFEFE, #9ad097); /* Opera 11.10+ */
+ background-image: -webkit-gradient(linear, 0% 0%, 0% 100%, from(rgb(254, 254, 254)), to(rgb(154, 208, 151)));
+ background-image: linear-gradient(top, #FEFEFE, #9ad097);
+ filter: progid:DXImageTransform.Microsoft.gradient(startColorStr='#FEFEFE', EndColorStr='#9ad097'); /* IE6�IE9 */
+ cursor: hand;
+ cursor: pointer;
+ z-index: 1;
+ }
+.mapShortcut:hover {
+ border: 1px solid #678AC7;
+ }
+#mapLegend {
+ position: absolute;
+ bottom: 60px;
+ left: 10px;
+ text-indent: -9000px;
+ display: block;
+ width: 330px;
+ height: 62px;
+ /*background: url(mapLegend.gif);
+ background: #FFF;*/
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ color: #000;
+ }
+/* FLY OUT */
+#memberLocations {
+ text-align: left;
+ display: none;
+ background: #999;
+ position: absolute;
+ left: /*9*/5px;
+ top: 10px;
+ background-color: #cfcfcf;
+ height: 510px;
+ width: 30px;
+ width: 966px;
+ border: 1px solid #f0f0f0;
+ overflow: hidden;
+ z-index: 19;
+ }
+#MapCountiesCities {
+ zoom: 1;
+ overflow: hidden;
+ background: white;
+ padding-bottom: 10px;
+ }
+#MapCountiesCities ul,
+#MapCountiesCities li {
+ margin: 0;
+ padding: 0;
+ display: block;
+ list-style-type: none;
+ }
+#MapCountiesCities ul {
+ margin-top: 6px;
+ }
+#mapCounties {
+ width: 110px;
+ float: left;
+ margin: 0 10px;
+ font-size: 13px;
+ padding-top: 6px;
+ }
+#mapCounties li {
+ width: 100px;
+ }
+#mapCities {
+ width: 833px;
+ float: left;
+ font-size: 11px;
+ padding-top: 6px;
+ }
+#MapCountiesCities b {
+ font-size: 16px;
+ }
+li.mapCity,
+li.mapCounty {
+ float: left;
+ }
+li.mapCity {
+ width: 118px;
+ }
+#MapCountiesCities a {
+ display: block;
+ background: url({/literal}{$assetsUrl}{literal}/bg_caption.jpg) no-repeat 2px 9px;
+ padding: 3px 2px 3px 20px;
+ }
+#MapCountiesCities .mapCity a {
+ padding: 1px 2px 2px 7px;
+ background: url({/literal}{$assetsUrl}{literal}/bg_caption.jpg) no-repeat -7px 7px;
+ }
+#MapCountiesCities a:hover {
+ background-color: #E7E7D5;
+ }
+/* LABELS in DROPDOWN */
+label.catLabel {
+ font-size: 11px;
+ text-align: left;
+ display: block;
+ margin: 0;
+ padding: 2px;
+ border-bottom: 1px dashed #ccc;
+ }
+label.catLabel:hover {
+ background: #ccc;
+ }
+.closer {
+ position: relative;
+ bottom: 0;
+ left: 0;
+ clear: both;
+ }
+
+#debugGlm {display:none;width:300px;height:300px;position: absolute;left:90px;top:300px;background-color: lightgrey;}
+#map-canvas {
+ text-align: left;
+}
+#LeafletMapContainer img.leaflet-tile,
+#LeafletMapContainer img.leaflet-marker-icon {
+ box-shadow: none;
+ border: none;
+}
+#LeafletMapContainer * img {
+ border: none !important;
+ border-radius: none !important;
+ box-shadow: none !important;
+ box-sizing: inherit !important;
+}
+div.catName {
+ background: #790000;
+ border: 0;
+ border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
+ color: #fff;
+ cursor: pointer;
+ display: block;
+ font-weight: normal;
+ padding: 10px 5px 10px 5px;
+ margin: 0;
+}
+.up {
+ margin: 0;
+ padding: 10px;
+ background: #790000;
+ text-align: left;
+ font-size: 10px;
+ color: #fff;
+}
+/* Interactive Map */
+#mapwrap {
+ background: none;
+ height: 527px;
+ width: 100%;
+ max-width: 100%;
+ overflow: hidden;
+ margin: 0;
+ padding: 0;
+ position: relative;
+}
+#mapwrap img {
+ -webkit-box-shadow: none;
+ -moz-box-shadow: none;
+ box-shadow: none;
+}
+#myMap {
+ display: block;
+ position: absolute;
+ top: 64px;
+ left: 0;
+ width: 100%;
+ height: 467px;
+ border: 1px solid #790000;
+}
+#mapLegend {
+ position: absolute;
+ bottom: 30px !important;
+ left: 10px;
+ text-indent: -9000px;
+ display: block;
+ width: 330px;
+ height: 62px;
+ background: url({/literal}{$assetsUrl}{literal}/mapLegend.gif) !important;
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ color: #000;
+ border-radius: 8px;
+ }
+form#category-form {
+ display: block;
+ width: 100%;
+ overflow: visible;
+ margin: 22px 0 0 0;
+ padding: 0;
+}
+ul#memberCategoryBox {
+ display: block;
+ width: 100%;
+ margin: 0;
+ padding: 0;
+ list-style-type: none;
+ position: relative;
+}
+ul#memberCategoryBox li.categoryBox {
+ border: 0;
+ display: block;
+ float: left;
+ margin: 0;
+ padding: 0 1px;
+ /*position: relative;*/
+ width: 14.1%;
+ /*width: auto;*/
+}
+div.catName {
+ background: #790000;
+ border: 0;
+ border-top-left-radius: 8px;
+ border-top-right-radius: 8px;
+ color: #FFFFFF;
+ cursor: pointer;
+ display: block;
+ font-weight: normal;
+ padding: 10px 5px 10px 5px;
+ margin: 0;
+}
+div.catName i {
+ padding-right: 16px;
+ font-size: 12px;
+}
+.up {
+ margin: 0;
+ padding: 10px;
+ background: #790000 url({/literal}{$assetsUrl}{literal}/upOff.png) no-repeat 80% center;
+ text-align: left;
+ font-size: 10px;
+ color: #FFF;
+}
+.up:hover {
+ background: #890000 url({/literal}{$assetsUrl}{literal}/upOn.png) no-repeat 80% center;
+ }
+div#memberLocations {
+ width: 90% !important;
+ overflow: scroll !important;
+ height: 400 !important;
+}
+</style>
+{/literal}
+
+<div id="mapwrap">
+<!-- Leaflet Map -->
+<link rel="stylesheet" href="https://unpkg.com/leaflet@1.3.3/dist/leaflet.css" integrity="sha512-Rksm5RenBEKSKFjgI3a41vrjkw4EVPlJ3+OiI65vTjIdo9brlAacEuKOiQ5OFh7cOI1bkDwLqdLw3Zg0cRJAAQ==" crossorigin=""/>
+<script src="https://unpkg.com/leaflet@1.3.3/dist/leaflet.js" integrity="sha512-tAGcCfR4Sc5ZP5ZoVz0quoZDYX5aCtEm/eu1KhSLj2c9eFrylXZknQYmxUssFaVJKvvc0dJQixhGjG2yXWiV9Q==" crossorigin=""></script>
+<link rel="stylesheet" href="{$jsUrl}/LeafletMarkerCluster/dist/MarkerCluster.Default.css" />
+<link rel="stylesheet" href="{$jsUrl}/LeafletAwesomeMarkers/leaflet.awesome-markers.css" />
+<script src="{$jsUrl}/LeafletAwesomeMarkers/leaflet.awesome-markers.min.js"></script>
+<script src="{$jsUrl}/LeafletMarkerCluster/dist/leaflet.markercluster-src.js"></script>
+<link rel="stylesheet" href="{$jsUrl}/Leaflet.loading/src/Control.Loading.css" />
+<script src="{$jsUrl}/Leaflet.loading/src/Control.Loading.js"></script>
+<script src="{$jsUrl}/leaflet-area-map.js"></script>
+<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.5.0/css/all.css" integrity="sha384-B4dIYHKNBt8Bc12p+WXckhzcICo0wtJAoU8YZTY5qE0Id1GSseTk6S+L3BlXeVIU" crossorigin="anonymous">
+
+<div id="myMap">
+ {* Member Map *}
+ <div id="LeafletMapContainer" style="height: 465px; width: 100%; border: 1px black solid; z-index: +0;"></div>
+</div>
+<form id="category-form">
+<ul id="memberCategoryBox">
+ {foreach $categories as $category_id => $catData}
+ <li id="cat-{$category_id}" class="categoryBox">
+ <div class="catName" id="cat-main-open-{$category_id}"><i>{$catData.name}</i></div>
+ <div id="cat-main-{$category_id}" class="showHideDiv">
+ {foreach $catData.subCats as $subCatData}
+ <label class="catLabel">
+ <input type="checkbox" name="category[]" value="{$subCatData.id}" />
+ {$subCatData.name}
+ </label>
+ {/foreach}
+ <div id="cat-main-close-{$category_id}" class="closer"><div class="up">Close</div></div>
+ </div>
+ </li>
+ {/foreach}
+</ul>
+</form>
+<div class="mapShortcut" id="memLocHdr">
+ Zoom to Cities and Counties
+</div>
+<ul id="mapLegend">
+ <li>Green = Places to Stay</li>
+ <li>Red = Attractions</li>
+ <li>Blue = Recreation</li>
+ <li>Brown = Transportation</li>
+ <li>Yellow = Dining</li>
+ <li>Orange = Shopping</li>
+ <li>Purple = Services</li>
+ <li>Grey = Multiple Categories</li>
+</ul>
+<div id="memberLocations">
+ <div id="MapCountiesCities">
+ <div id="mapCounties">
+ <b>Counties:</b>
+ <ul>
+ {* foreach regions region *}
+ <li class="mapCounty">
+ <a href="#" rel="{* region[region_id] *}">{* region[region_name] *}</a>
+ </li>
+ {* /foreach *}
+ </ul>
+ </div><!-- /#mapCounties -->
+ <div id="mapCities">
+ <b>Cities:</b>
+ <ul>
+ {* foreach cities city *}
+ <li class="mapCity">
+ <a href="#" rel="{* city[city_id] *}">{* city[city_name] *}</a>
+ </li>
+ {* /foreach *}
+ </ul>
+ </div>
+ </div>
+</div>
+<div id="debugGlm">
+
+</div>
+
+</div><!-- /#mapwrap -->
+<script>
+ glm_ajax_url = '{$ajaxUrl}';
+ glm_memberCats = [
+ 793, // Places to Stay
+ 791, // Attractions
+ 794, // Recreation
+ 792, // Dining
+ 796, // Shopping
+ 795, // Services
+ 797 // Transportation
+ ];
+</script>