samedi 21 avril 2018

web map ctaLayers?

I'm making a mistake. I can not open the kmz files in one map, I can not find the code group where I am making the mistake. I can not find the code group where I am making the mistake. I have 3 map kmz files I want to open these maps on a web map, but you can help me if I do not succeed.

var map; 
    $(document).ready(function () {
                var mapOptions = {
                zoom: 9,
         center: new google.maps.LatLng(37.8690709, 32.5552064),
         mapTypeId: google.maps.MapTypeId.HYBRID
                }
      map = new google.maps.Map(document.getElementById("#map-container")[0], mapOptions);

          var ctalayers = [];
      ctalayers[0] = new google.maps.KmlLayer({
                  'preserveViewport': true,
                  'scrollwheel': true,
                  'http://atlas.tacirinden.com/dosyalar/4201_ATLAS.kmz?o=' + Math.random()'}),
      ctalayers[1] = new google.maps.KmlLayer({
                  'preserveViewport': true,
                  'scrollwheel': true,
                  'http://sns.tacirinden.com/dosyalar/4202_SNS.kmz?o=' + Math.random()'}), 
      ctalayers[2] = new google.maps.KmlLayer({
                  'preserveViewport': true,
                  'scrollwheel': true,
                  'http://yuva.tacirinden.com/dosyalar/4204_YUVA.kmz?o=' + Math.random()'}), 
      ctalayers[3] = new google.maps.KmlLayer({
                  'preserveViewport': true,
                  'scrollwheel': true,
                  'http://karatay.tacirinden.com/dosyalar/4205_KARATAY.kmz?o=' + Math.random()'}),               
                
                ctaLayers.setMap(null);
                ctaLayers.set('preserveViewport', true);

                setInterval(function () {reload(); }, 60000);

                var ctaLayersTmp;

                function reload() {                

                    google.maps.event.addListener(ctaLayerTmp, "status_changed", function() {
                        ctaLayers.setMap(null);
                        ctaLayersTmp.set('preserveViewport', true);
                        ctaLayers = ctaLayersTmp;                     
                    });
                    ctaLayersTmp.setMap(map);
                }
                ctaLayers.setMap(map);
            });

        </script>
    </body>



Aucun commentaire:

Enregistrer un commentaire