techiva / jquery-ui-map

Automatically exported from code.google.com/p/jquery-ui-map
0 stars 0 forks source link

find does not work in 3.0 rc works with 3.0 beta #49

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Download jquery-ui-map-3.0-rc.zip 
2. In demos/jquery-google-maps-filtering.html replace with the example code 
given on that page:
$('#map_canvas').gmap({'center': '59.3426606750, 18.0736160278' }).bind('init', 
function () {
    $('#map_canvas').gmap('addMarker', { 'foo': 'bar', 'position': '59.3426606750, 18.0736160278' });
    $('#map_canvas').gmap('addMarker', { 'foo': 'baz', 'position': '58.3426606750, 18.0736160278' });
    $('#map_canvas').gmap('find', 'markers', { 'property': 'foo', 'value': 'bar' }, function(marker, found) {
        marker.setVisible(found);
    });
}); 
3. Test with the example code

What is the expected output? What do you see instead?
It was expected the 'find' will filter by property, but it did not perform as 
excpected. I had tested the same with jquery-ui-map-3.0-beta and the 3.0 beta 
works.

What version of the product are you using? On what operating system?
jquery-ui-map-3.0-beta, Ubuntu 10.04 LTS/OSX Chrome, FF

Please provide any additional information below.
It seems like find could not retrieve the property (tags, categories etc) and 
this is only in 3.0 rc. It works with 3.0 beta.

Original issue reported on code.google.com by monyiliev on 9 May 2012 at 10:28

GoogleCodeExporter commented 8 years ago
Thank you, monyiliev, for filing this. I started using 'find' about the same 
time you did - and find the same thing: in my simple example beta 3 works, but 
rc doesn't.

Original comment by libby.ba...@gmail.com on 10 May 2012 at 4:00

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Thank you monyiliev for this issue, I lost 2 days trying make find filter work 
((
Now reinstall to beta and the find works. But functionality is significant 
reduced - The find method n-n doesnt included - thus unable to work with 
multiple checkboxes in v.3.0-beta

Original comment by rkc...@gmail.com on 23 May 2012 at 3:48

GoogleCodeExporter commented 8 years ago
Here is a solution. Coz the tricky question was how their example works. 
Property value should be an array placed in brackets like ['bar'] instead of 
'bar'. Same is for find value. Here is same working code in 3.0 rc:

$('#map_canvas').gmap({'center': '59.3426606750, 18.0736160278' }).bind('init', 
function () {
    $('#map_canvas').gmap('addMarker', { 'foo': ['bar'], 'position': '59.3426606750, 18.0736160278' });
    $('#map_canvas').gmap('find', 'markers', { 'property': 'foo', 'value': ['bar'] }, function(marker, found) {
        marker.setVisible(found);
    });
});

Best Regards from Georgia ))

Original comment by rkc...@gmail.com on 23 May 2012 at 5:10

GoogleCodeExporter commented 8 years ago
Georgia,
thank you for the great sample code. It would be great if this is included in 
the examples.

Original comment by monyiliev on 23 May 2012 at 5:15

GoogleCodeExporter commented 8 years ago
Well Monyiliev,
imho it's still a bug, coz in API the find method stated as "The value can be 
either an array or a string". Right now only an array works.

Let's wait for update of this issue.

Roman K.

Original comment by rkc...@gmail.com on 23 May 2012 at 5:28

GoogleCodeExporter commented 8 years ago
Roman,
I agree, for now I'm sticking with the beta as it's been working fine.

Thanks

Original comment by monyiliev on 23 May 2012 at 5:33

GoogleCodeExporter commented 8 years ago
ah at last i found this page T^T
took me a whole week to find this solution 
thank you so much Georgia and Monyiliev for bringing up this issue

thank youuuuuu sooo much  ^^v

Original comment by yokaise...@gmail.com on 2 Jul 2012 at 3:58

GoogleCodeExporter commented 8 years ago
it would be great if the documentation was even close! The examples here: 
http://code.google.com/p/jquery-ui-map/wiki/Examples for the search 
function(marker, found) are backwards!

Original comment by jonp...@gmail.com on 18 Jul 2012 at 7:39

GoogleCodeExporter commented 8 years ago
To solve this bug replace line 199:

if ( $.inArray(options.value[value], obj[property][options.property]) > -1 ) {

by:

if ( options.value[value] == obj[property][options.property] ) {

This works with both arrays and string

Original comment by i...@visionears.nl on 7 Sep 2012 at 8:34

GoogleCodeExporter commented 8 years ago
it works 4 me!! Thx! 

Original comment by didier.d...@gmail.com on 30 Sep 2012 at 6:54

GoogleCodeExporter commented 8 years ago
hello every one , thanks for the great post , I need two or more filters (find) 
on my project . Please  suggest me how to implement it .

thanks --
deepak bajpai

Original comment by deepak...@gmail.com on 15 Oct 2012 at 9:55

GoogleCodeExporter commented 8 years ago
My problem with find is that each one of the checkboxes hides all of the icons, 
the filter by property doesn't work.  I cannot figure out why.  Does anyone 
have any suggestions?

Original comment by egmhan...@gmail.com on 11 Jan 2013 at 5:12

GoogleCodeExporter commented 8 years ago
Thank you Roman K. for the solution!!!

Original comment by milanez...@gmail.com on 14 Feb 2013 at 3:51

GoogleCodeExporter commented 8 years ago
Thanks :)

Original comment by khemsis...@gmail.com on 16 Feb 2013 at 10:47

GoogleCodeExporter commented 8 years ago
I had problem filtering because I assinged strings to Markes, this is the 
correct way to add tags in order to make filter work:

$('#map_canvas').gmap('addMarker', { 'tags' : ["teatro"] });

And then you can filter by string or array in 

$('#map_canvas').gmap('find', 'markers', { 'property': 'tags', 'value': 
"teatro", 'operator': 'OR' }, function(marker, found) {
});

or 
var filters = [];
$('input:checkbox:checked').each(function(i, checkbox) {
  filters.push($(checkbox).val());
});
$('#map_canvas').gmap('find', 'markers', { 'property': 'tags', 'value': 
filters, 'operator': 'OR' }, function(marker, found) {
});

Original comment by dario....@gmail.com on 2 Jul 2013 at 2:36

GoogleCodeExporter commented 8 years ago
Dario,
Estou com o mesmo problema que você. Conseguiu resolver?
(I have a similar issue. Can You solved?)

Original comment by leanderc...@aol.com on 15 Jul 2013 at 3:01

GoogleCodeExporter commented 8 years ago
Thanks, placing it withing the brackets ['bar'] worked perfectly!

Original comment by atienk...@gmail.com on 16 Feb 2014 at 6:43

GoogleCodeExporter commented 8 years ago
can possible MarkerClusterer after find data 
if any solution so give me Please

Thanks, 

Original comment by ro...@optiinfo.com on 22 May 2014 at 1:26