diff --git a/FieldtypeMapMarker.module b/FieldtypeMapMarker.module index ac30386..4d66a6f 100644 --- a/FieldtypeMapMarker.module +++ b/FieldtypeMapMarker.module @@ -1,4 +1,4 @@ -isOperator($operator)) { + if($subfield != 'data' || $this->wire('db')->isOperator($operator)) { // if dealing with something other than address, or operator is native to SQL, // then let Fieldtype::getMatchQuery handle it instead return parent::getMatchQuery($query, $table, $subfield, $operator, $value); diff --git a/InputfieldMapMarker.js b/InputfieldMapMarker.js index f83910a..a248520 100644 --- a/InputfieldMapMarker.js +++ b/InputfieldMapMarker.js @@ -101,17 +101,11 @@ var InputfieldMapMarker = { return true; }); - // added by diogo to solve the problem of maps not rendering correctly in hidden elements - // trigger a resize on the map when either the tab button or the toggle field bar are pressed - - // get the tab element where this map is integrated - var $map = $('#' + mapId); - var $tab = $('#_' + $map.closest('.InputfieldFieldsetTabOpen').attr('id')); - // get the inputfield where this map is integrated and add the tab to the stack - var $inputFields = $map.closest('.Inputfield').find('.InputfieldStateToggle').add($tab); - - $inputFields.on('click',function(){ - // give it time to open + // added by diogo to solve the problem of maps not rendering correctly in hidden elements - updated by Tom + // trigger a resize on the map when either the tab or toggle state is clicked + $.fn.attrChange=function(t,r,a){return this.each(function(){var e=this,n=new MutationObserver(function(e){e.forEach(function(e){var n=$(e.target).prop(e.attributeName);e.attributeName===t&&(n=n.split(" "),-1===$.inArray(r,n)&&a())})});n.observe(e,{attributes:!0})})}; + + $map.closest('.Inputfield').attrChange("class", "InputfieldStateHidden", function(){ window.setTimeout(function(){ google.maps.event.trigger(map,'resize'); map.setCenter(options.center); diff --git a/InputfieldMapMarker.module b/InputfieldMapMarker.module index 0e29c36..83710bd 100644 --- a/InputfieldMapMarker.module +++ b/InputfieldMapMarker.module @@ -1,4 +1,4 @@ -config->scripts->add(($this->config->https ? 'https' : 'http') . '://maps.google.com/maps/api/js?sensor=false'); + $this->config->scripts->add(($this->config->https ? 'https' : 'http') . '://maps.google.com/maps/api/js'); return parent::init(); } diff --git a/MapMarker.php b/MapMarker.php index 9c063ff..d814b36 100644 --- a/MapMarker.php +++ b/MapMarker.php @@ -1,4 +1,4 @@ -text($value); + $value = $this->wire('sanitizer')->text($value); } else if($key == 'status') { $value = (int) $value; @@ -76,7 +76,7 @@ public function geocode() { return 0; } - $url = "http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address=" . urlencode($this->address); + $url = "http://maps.googleapis.com/maps/api/geocode/json?address=" . urlencode($this->address); $json = file_get_contents($url); $json = json_decode($json, true); diff --git a/MarkupGoogleMap.module b/MarkupGoogleMap.module index 8cdd906..572792f 100644 --- a/MarkupGoogleMap.module +++ b/MarkupGoogleMap.module @@ -1,4 +1,4 @@ -