Skip to content

Commit

Permalink
2.0.0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
stiofan committed Dec 20, 2018
1 parent 7285583 commit aff329d
Show file tree
Hide file tree
Showing 8 changed files with 187 additions and 133 deletions.
37 changes: 37 additions & 0 deletions assets/js/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,43 @@ function build_map_ajax_search_param(map_canvas, reload_cat_list, catObj, hide_l
return geodir_map_post_type_terms(options, post_type, query_string);
}


// MC
var map_info = '';
if (jQuery.goMap.map && options.marker_cluster_server) { // map loaded so we know the bounds
bounds = jQuery.goMap.map.getBounds();
gd_zl = jQuery.goMap.map.getZoom();

if(bounds){
if (window.gdMaps == 'osm') {
gd_lat_ne = bounds.getNorthEast().lat;
gd_lon_ne = bounds.getNorthEast().lng;
gd_lat_sw = bounds.getSouthWest().lat;
gd_lon_sw = bounds.getSouthWest().lng;
} else {
gd_lat_ne = bounds.getNorthEast().lat();
gd_lon_ne = bounds.getNorthEast().lng();
gd_lat_sw = bounds.getSouthWest().lat();
gd_lon_sw = bounds.getSouthWest().lng();
}
map_info = "&zl=" + gd_zl + "&lat_ne=" + gd_lat_ne + "&lon_ne=" + gd_lon_ne + "&lat_sw=" + gd_lat_sw + "&lon_sw=" + gd_lon_sw;
}

} else if (options.marker_cluster_server && !options.autozoom) { // map not loaded and auto zoom not set
gd_zl = options.zoom;
gd_map_h = jQuery('#' + map_canvas).height();
gd_map_w = jQuery('#' + map_canvas).width();
map_info = "&zl=" + gd_zl + "&gd_map_h=" + gd_map_h + "&gd_map_w=" + gd_map_w;
} else if (options.marker_cluster_server && options.autozoom) { // map not loaded and auto zoom set
gd_zl = options.zoom;
gd_map_h = jQuery('#' + map_canvas).height();
gd_map_w = jQuery('#' + map_canvas).width();
map_info = "&zl=" + gd_zl + "&gd_map_h=" + gd_map_h + "&gd_map_w=" + gd_map_w;
}

query_string += map_info;
// /MC

search = jQuery('#' + map_canvas + '_search_string').val();


Expand Down
4 changes: 2 additions & 2 deletions assets/js/map.min.js

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion change_log.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Cannot un-select all tags in add listing form - FIXED
User avatar overlaps some text in dashboard recent reviews widget - FIXED
Save custom field generates incorrect field key if not inserted - FIXED
On page refresh detail page map not loading if map tab is active - FIXED
404 rescue function sometimes not picking up a post_type from query vers - FIXED
404 rescue function sometimes not picking up a post_type from query vars - FIXED
Added geodirectory-single.php as option to override single template - ADDED
Post badge now has option to open link in new window and input or class wrapper - ADDED
Changes for Marker Cluster addon v2 - ADDED

v2.0.0.41
GD Listings widget sorting not showing custom sorting options - FIXED
Expand Down
4 changes: 2 additions & 2 deletions geodirectory.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
* Plugin Name: GeoDirectory
* Plugin URI: https://wpgeodirectory.com/
* Description: GeoDirectory plugin for WordPress.
* Version: 2.0.0.41
* Version: 2.0.0.42
* Author: AyeCode Ltd
* Author URI: https://wpgeodirectory.com
* Text Domain: geodirectory
Expand Down Expand Up @@ -60,7 +60,7 @@ final class GeoDirectory {
*
* @var string
*/
public $version = '2.0.0.41';
public $version = '2.0.0.42';

/**
* GeoDirectory instance.
Expand Down
10 changes: 5 additions & 5 deletions includes/widgets/class-geodir-widget-map.php
Original file line number Diff line number Diff line change
Expand Up @@ -570,15 +570,15 @@ public function set_arguments() {
'advanced' => true,
)
);
if ( defined( 'GDCLUSTER_VERSION' ) ) { // @todo we can move this in marker cluster plugin.
if ( defined( 'GEODIR_MARKERCLUSTER_VERSION' ) ) {
$arguments['marker_cluster'] = array(
'type' => 'checkbox',
'title' => __( 'Enable marker cluster?', 'geodirectory' ),
'desc' => __( 'This enables marker cluster on the map.', 'geodirectory' ),
'placeholder' => '',
'desc_tip' => true,
'value' => '1',
'default' => '0',
'default' => '1',
'advanced' => true,
'element_require' => '[%map_type%]!="post"',
);
Expand Down Expand Up @@ -694,7 +694,7 @@ public function output( $args = array(), $widget_args = array(), $content = '' )
'cat_filter' => true,
'child_collapse' => false,
'map_directions' => true,
'marker_cluster' => false,
// 'marker_cluster' => false,
'country' => '',
'region' => '',
'city' => '',
Expand Down Expand Up @@ -888,12 +888,12 @@ public static function render_map( $map_args ) {
'posts' => '',
'sticky' => false,
'map_directions' => false,
'marker_cluster' => false,
// 'marker_cluster' => false,
);

$params = wp_parse_args( $map_args, $defaults );

$params['marker_cluster'] = false; // @todo Implement via marker cluster plugin.
//$params['marker_cluster'] = false; // @todo Implement via marker cluster plugin.

// map type
if ( ! in_array( $params['map_type'], array( 'auto', 'directory', 'archive', 'post' ) ) ) {
Expand Down
Binary file modified languages/geodirectory-en_US.mo
Binary file not shown.
Loading

0 comments on commit aff329d

Please sign in to comment.