przezdziecki / geoxml3

Automatically exported from code.google.com/p/geoxml3
0 stars 0 forks source link

Multiple Select of KML FIles will later keep the KML from showing #33

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Link Checkboxlist to different KML files with 2 different center points.
2. Select and unselect random checkboxes to load/unload the KML files
3.

What is the expected output? What do you see instead?
Expected: KML layers needs to keep on showing
Instead, the map still renders but the KML overlays is not vissible anymore

What version of the product are you using? On what operating system?
<script type="text/javascript" 
src="http://geoxml3.googlecode.com/svn/branches/polys/geoxml3.js"></script>
<script type="text/javascript" 
src="http://geoxml3.googlecode.com/svn/trunk/ProjectedOverlay.js"></script>

Please provide any additional information below.

My code for this:
$('#rep1_cblist').change(function(event) {
                    getMyVal(event);
                    if (valtouse > 0 && valtouse != null && valtoremove == null) {
                        getKMLCB(valtouse);
                        if ((valtouse == "3" || valtouse == "4" || valtouse == "5") && (!geoXml.docs[0])) {
                            myLatLng = new google.maps.LatLng(-25.8500, 25.6333);

                            var myOptions = {
                                zoom: 11,
                                center: new google.maps.LatLng(-25.8500, 25.6333),
                                mapTypeId: google.maps.MapTypeId.ROADMAP
                            };
                            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
                        }
                        else if (valtouse == "1" || valtouse == "2" && (!geoXml.docs[0])) {
                            myLatLng = new google.maps.LatLng(-25.860792, 28.14338);
                            var myOptions = {
                                zoom: 11,
                                center: new google.maps.LatLng(-25.860792, 28.14338),
                                mapTypeId: google.maps.MapTypeId.ROADMAP
                            };
                            map = new google.maps.Map(document.getElementById("map_canvas"), myOptions);
                            sball = true;
                        }
                        if (geoXml.docs[0]) {
                            var cc = map.getCenter();
                            if (valtouse == "1" || valtouse == "2") {
                                myLatLng = new google.maps.LatLng(-25.860792, 28.14338);
                                var tmplat = cc.Na;
                                var tmplng = cc.Oa;
                                var curlat = myLatLng.Na;
                                var curlng = myLatLng.Oa;
                                if ((tmplat != curlat) && (tmplng != curlng)) {
                                    map.setCenter(myLatLng)
                                }
                            }
                            if (valtouse == "3" || valtouse == "4" || valtouse == "5") {
                                myLatLng = new google.maps.LatLng(-25.8500, 25.6333);
                                var tmplat = cc.Na;
                                var tmplng = cc.Oa;
                                var curlat = myLatLng.Na;
                                var curlng = myLatLng.Oa;
                                if ((tmplat != curlat) && (tmplng != curlng)) {
                                    map.setCenter(myLatLng)
                                }
                            }
                            filename = ('/KML/' + tmpkml);
                            var shown = false;
                            for (z = 0; z < geoXml.docs.length; z++) {
                                if (geoXml.docs[z].baseUrl == ('/KML/' + tmpkml)) {
                                    geoXml.showDocument(geoXml.docs[z]);
                                    shown = true;
                                    break;
                                }
                            }
                            if (!shown) {
                                geoXml.parse(filename);
                                geoXml.showDocument();
                            }
                        }
                        else {
                            geoXml = new geoXML3.parser({
                                map: map,
                                infoWindow: infowindow,
                                singleInfoWindow: false,
                                zoom: false,
                                afterParse: useTheData
                            });
                            newKML = tmpkml;
                            filename = newKML;
                            geoXml.parse('/KML/' + newKML);
                        }
                    }
                    else {
                        getKMLCB(valtoremove);
                        var removeindex = 0;
                        var removed = false;
                        for (y = 0; y < geoXml.docs.length; y++) {
                            if (geoXml.docs[y].baseUrl == ('/KML/' + tmpkml)) {
                                geoXml.hideDocument(geoXml.docs[y]);
                                valtoremove = null;
                                removed = true;
                                break;
                            }
                        }
                        if (!removed) {
                            geoXml.hideDocument();
                        }
                    }
                });

Original issue reported on code.google.com by TheMax...@gmail.com on 4 Aug 2011 at 6:56

GoogleCodeExporter commented 9 years ago
Can't reproduce the problem with the information given.  Could you provide a 
link to a map that exhibits the problem?

Original comment by geocodezip on 4 Aug 2011 at 12:28

GoogleCodeExporter commented 9 years ago
I am runnin it local at this stage. attached my full code.

Original comment by TheMax...@gmail.com on 5 Aug 2011 at 6:19

Attachments:

GoogleCodeExporter commented 9 years ago
Can't reproduce it without a link on a public site to a map that exhibits the 
problem.

Original comment by geocodezip on 7 Aug 2011 at 4:25

GoogleCodeExporter commented 9 years ago
I got it on a site now. http://www.mediamap.co.za/default.aspx 

The another question:
see http://www.dyasdesigns.com/geoxml/gmlusa.htm

there is a second div called messagearea, and i am trying to simulate it using 
geoxml3 on the mouserover, but i can not get the actual dscription from the 
info window if you should click it (loaded from the KML) from the ploy object I 
can gt the title, but not the Description?

Original comment by TheMax...@gmail.com on 18 Aug 2011 at 6:01

GoogleCodeExporter commented 9 years ago
I see the problem on that page, however, what makes you think it is a problem 
with geoxml3 and not your software?

Can you provide a simplified page that shows the issue with geoxml3?  (no .net 
stuff, no jquery, just html, kml and javascript)?

Or alternatively can you make the following page exhibit the problem:
http://www.geocodezip.com/geoxml3_test/www_mediamap_co_za_testA.html
(documents 0 and 1 seem to be the same)

> The another question:
> see http://www.dyasdesigns.com/geoxml/gmlusa.htm
> 
> there is a second div called messagearea, and i am trying to simulate it 
using 
> geoxml3 on the mouserover, but i can not get the actual dscription from the 
info 
> window if you should click it (loaded from the KML) from the ploy object I 
can gt 
> the title, but not the Description?

The issues list is not for support.  If you need support, please post your 
question to the Google Maps JavaScript API v3 group.

Original comment by geocodezip on 21 Aug 2011 at 4:12

GoogleCodeExporter commented 9 years ago
Thanx
Through viewing your page etc, i have sorted out 90% of the issues.
Right now, I have only one linked issue remaining to this query, and i think it 
is in the different approaches.
You Parse all the documents imidiately, so you have them all already loaded, 
before any clicking or anything happens.
I am trying to 'load' 'add' kml files on a click event, so here is my question.

If the parse is not yet instantiated, I call:

 geoXml = new geoXML3.parser({          map: map,
                                        infoWindow: infowindow,
                                        singleInfoWindow: false,
                                        zoom: false,
                                        processStyles: true,
                                        afterParse: useTheData
                                    });
                            geoXml.parse(filename);

Now if the parser does already exist, I simply call:

                                    geoXml.parse(filename);
                                    geoXml.showDocument();

Does this then overwrite the existing files, ie, if it exist should i rather 
call
geoXML.parse(existingfilename,newfilename) ?
Thanx

Original comment by TheMax...@gmail.com on 9 Sep 2011 at 1:54

GoogleCodeExporter commented 9 years ago
I looked at the examples, and decided to put it into an array, and load all
However, as I do not now the filenames etc beforehand, as it is generated from 
a database, I put the files into a array, but although it seems that geoxml 
supports and array, it does not support an actual array, or am i missing 
something ?

 var tmpfilenames = new Array(); 
for (tf = 0; tf < filesplit.length; tf++) {
tmpfilenames[tf] = filesplit[tf];
}
geoXml.parse([tmpfilenames]); --FAILS!
geoXml.parse(tmpfilenames); --FAILS!
geoXml.parse([tmpfilenames.toString()]); -- FAILS!
geoXml.parse(tmpfilenames.toString()); -- FAILS!

This seems to be my final issue, as i have workedout all the other kinks i had, 
mainly thanks to the assistance here, this is my final hurdle.

Original comment by TheMax...@gmail.com on 14 Sep 2011 at 6:33

GoogleCodeExporter commented 9 years ago
geoXml.parse(tmpfilenames); --FAILS! ---should work if tmpfilenames is an array 
of URLs

I don't see a problem using the correct syntax:
http://www.geocodezip.com/geoxml3_test/v3_geoxml3_array_linkto.html

Please provide a link to your map that exhibits this problem. 

Original comment by geocodezip on 15 Sep 2011 at 2:26

GoogleCodeExporter commented 9 years ago

Original comment by geocodezip on 23 Nov 2011 at 3:56