← WordPress

[Ajuda] Tema de Wordpress

Lida 2555 vezes

Offline

Rogério Moreira 
Editor
Mensagens 1313 Gostos 11
Feedback +15

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

Alguém me dá uma ajudinha aqui num tema?  :lol:

É o seguinte, comprei o tema Navigation (http://themeforest.net/item/the-navigator-premium-wp-location-guide-blog/397351?WT.ac=category_item)

Demo: http://themeforest.net/item/the-navigator-premium-wp-location-guide-blog/full_screen_preview/397351

O que queria era substituir o mapa do mundo apenas pelo de Portugal. É possível?

Cumprimentos.
Offline

GhostMaster 
Membro
Mensagens 1374 Gostos 0
Feedback +10

Troféus totais: 26
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 5 Level 4 Level 3 Level 2 Level 1 1000 Posts

Parece-me que dá mas também não te sei dizer exactamente como, já leste a documentação?

Eu recomendava perguntares também ao autor, ele é que te poderá responder melhor e mais rápido a isso.

Cumprimentos.
Offline

Rogério Moreira 
Editor
Mensagens 1313 Gostos 11
Feedback +15

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

Parece-me que dá mas também não te sei dizer exactamente como, já leste a documentação?

Eu recomendava perguntares também ao autor, ele é que te poderá responder melhor e mais rápido a isso.

Cumprimentos.

Estou a ler agora a documentação.

Antes de perguntar aqui já tinha perguntado ao autor, estou à espera da resposta.
Offline

davids 
Membro
Mensagens 217 Gostos 0
Feedback +2

Troféus totais: 24
Trófeus: (Ver todos)
Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts

tens de criar um API com o google maps se não me engano!
Cumps
Offline

diogoosorio 
Membro
Mensagens 134 Gostos 1
Feedback +1

Troféus totais: 22
Trófeus: (Ver todos)
Super Combination Combination Topic Starter Poll Voter Level 4 Level 3 Level 2 Level 1 100 Posts 50 Posts

Tens aqui a documentação do plugin que o tema utiliza para interagir com o Google Maps: http://gmap3.net/api.html

De qualquer das formas, abre o ficheiro onde está contido o mapa e procura este trecho de código:

Código: (javascript) [Seleccione]
//<![CDATA[
jQuery.noConflict(); jQuery(document).ready(function(){  
    //MAP ZOOM
     var zoomLevel = 3,
gMap = jQuery("#gMap"),
//iPad,iPhone,iPod...
deviceAgent = navigator.userAgent.toLowerCase(),
iPadiPhone = deviceAgent.match(/(iphone|ipod|ipad)/);

//iPad Stuff
if (iPadiPhone) {

jQuery("#footer").prepend('<div class="markerNav" title="Prev" id="prevMarker">&lsaquo;</div><div id="markers"></div><div class="markerNav" title="Next" id="nextMarker">&rsaquo;</div><div id="mapTypeContainer"><div id="mapStyleContainer"><div id="mapStyle" class="satellite"></div></div><div id="mapType" title="Map Type" class="satellite"></div></div>');
} else {
jQuery('#zoomIn').live('click',function(){
zoomLevel += 1;
gMap.gmap3({action: 'setOptions', args:[{zoom:zoomLevel}]});
});
jQuery('#zoomOut').live('click',function(){
zoomLevel -= 1;
gMap.gmap3({action: 'setOptions', args:[{zoom:zoomLevel}]});
});
       jQuery("#footer").prepend('<div class="markerNav" title="Prev" id="prevMarker">&lsaquo;</div><div id="markers"></div><div class="markerNav" title="Next" id="nextMarker">&rsaquo;</div><div id="mapTypeContainer"><div id="mapStyleContainer"><div id="mapStyle" class="satellite"></div></div><div id="mapType" title="Map Type" class="satellite"></div></div><div class="zoomControl" title="Zoom Out" id="zoomOut"><img src="http://themes.themolitor.com/wpnavigator/wp-content/themes/wpnavigator/images/zoomOut.png" alt="-" /></div><div class="zoomControl" title="Zoom In" id="zoomIn"><img src="http://themes.themolitor.com/wpnavigator/wp-content/themes/wpnavigator/images/zoomIn.png" alt="+" /></div>');
    }    
        jQuery('body').prepend("<div id='target'></div>");
        
        gMap.gmap3({
         action: 'init',
            onces: {
              bounds_changed: function(){
               var number = 0;
                jQuery(this).gmap3({
                  action:'getBounds',
                  callback: function (){
                                     add(jQuery(this), number += 1, "Colosseum", "http://themes.themolitor.com/wpnavigator/2011/07/colosseum/","Via Sforza, 10<br />00184 Roma, Italy","41.890202","12.492228", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/Colosseum_in_Rome_Italy_-_April_2007-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="Colosseum_in_Rome,_Italy_-_April_2007" title="Colosseum_in_Rome,_Italy_-_April_2007" />');                   add(jQuery(this), number += 1, "Iguazu Falls", "http://themes.themolitor.com/wpnavigator/2011/07/iguazu-falls/","Iguazu Falls<br />Misiones, Argentina","-25.69506","-54.440432", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/27_iguac-fall-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="27_iguac-fall" title="27_iguac-fall" />');                   add(jQuery(this), number += 1, "Great Barrier Reef", "http://themes.themolitor.com/wpnavigator/2011/07/great-barrier-reef/","Great Barrier Reef<br />Australia","-10.21053","142.159653", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/great_barrier_reef_queensland_australia-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="great_barrier_reef_queensland_australia" title="great_barrier_reef_queensland_australia" />');                   add(jQuery(this), number += 1, "Statue of Liberty", "http://themes.themolitor.com/wpnavigator/2011/07/statue-of-liberty/","Liberty Island<br />New York, NY 10004","40.69005","-74.045067", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/large_5-8Statue-Of-Liberty-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="Statue Of Liberty" title="Statue Of Liberty" />');                   add(jQuery(this), number += 1, "Chichen Itza", "http://themes.themolitor.com/wpnavigator/2011/07/chichen-itza/","Chichen Itza<br />Mexico","20.683341","-88.569009", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/Ancient_Mayan_Ruins_Chichen_Itza_Mexico-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="Ancient_Mayan_Ruins_Chichen_Itza_Mexico" title="Ancient_Mayan_Ruins_Chichen_Itza_Mexico" />');                   add(jQuery(this), number += 1, "Taj Mahal", "http://themes.themolitor.com/wpnavigator/2011/07/taj-mahal/","Taj Mahal<br />Agra, India","27.174799","78.042111", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/2008_05_13-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="2008_05_13" title="2008_05_13" />');                   add(jQuery(this), number += 1, "Great Wall of China", "http://themes.themolitor.com/wpnavigator/2011/07/great-wall-of-china/","Great Wall of China<br />Beijing, China","40.429076","116.568219", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/20110402125112822-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="20110402125112822" title="20110402125112822" />');                   add(jQuery(this), number += 1, "Stonehenge", "http://themes.themolitor.com/wpnavigator/2011/07/stonehenge/","4 A344 Road<br />Wiltshire, Salisbury SP4 7DE, UK","51.178859","-1.82622", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/Stonehenge-1-K74P8BS7LT-1600x1200-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="Stonehenge-1-K74P8BS7LT-1600x1200" title="Stonehenge-1-K74P8BS7LT-1600x1200" />');                   add(jQuery(this), number += 1, "Great Pyramid of Giza", "http://themes.themolitor.com/wpnavigator/2011/07/great-pyramid-of-giza/","Great Pyramid of Giza<br />Egypt","29.977316","31.132314", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/Pyramids_of_Giza-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="Pyramids_of_Giza" title="Pyramids_of_Giza" />');                   add(jQuery(this), number += 1, "Grand Canyon", "http://themes.themolitor.com/wpnavigator/2011/07/grand-canyon/","Grand Canyon<br />Williams, AZ","36.34313","-112.51339", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/arizona-grand-canyon-703-2-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="arizona-grand-canyon-703-2" title="arizona-grand-canyon-703-2" />');                   add(jQuery(this), number += 1, "Eiffel Tower", "http://themes.themolitor.com/wpnavigator/2011/07/eiffel-tower/","Parc du Champ de Mars, 5 Ave Anatole France <br />75007 Paris, France","48.858588","2.293847", '<img width="95" height="95" src="http://themes.themolitor.com/wpnavigator/files/2011/07/eiffel-tower03-95x95.jpg" class="attachment-post-thumbnail wp-post-image" alt="eiffel-tower03" title="eiffel-tower03" />');                  }
                });
              }
            }
          },{
action: 'setOptions', args:[{
zoom:zoomLevel,
scrollwheel:false,
disableDefaultUI:true,
disableDoubleClickZoom:true,
draggable:true,
mapTypeControl:false,
mapTypeId:'roadmap',
panControl:false,
scaleControl:false,
streetViewControl:false,
zoomControl:false
}]
});
        function add(jQuerythis, i, title, link, excerpt, lati, longi, img){
          jQuerythis.gmap3({
            action : 'addMarker',
            lat:lati,
            lng:longi,
            options: {icon: new google.maps.MarkerImage('http://themes.themolitor.com/wpnavigator/wp-content/themes/wpnavigator/images/pin.png')},
            events:{
       mouseover: function(marker){
           jQuerythis.css({cursor:'pointer'});
           jQuery('#markerTitle'+i+'').fadeIn({ duration: 200, queue: false }).animate({bottom:"32px"},{duration:200,queue:false});
           jQuery('.markerInfo').removeClass('activeInfo').hide();
           jQuery('#markerInfo'+i+'').addClass('activeInfo').show();
           jQuery('.marker').removeClass('activeMarker');
           jQuery('#marker'+i+'').addClass('activeMarker');
       },
       mouseout: function(){
           jQuerythis.css({cursor:'default'});
           jQuery('#markerTitle'+i+'').stop(true,true).fadeOut(200,function(){jQuery(this).css({bottom:"0"})});
       },
       click: function(marker){window.location = link}
   },
            callback: function(marker){
              var jQuerybutton = jQuery('<div id="marker'+i+'" class="marker"><div id="markerInfo'+i+'" class="markerInfo"><a href="'+link+'">'+img+'</a><h2><a href="'+link+'">'+title+'</a></h2><p>'+excerpt+'</p><a class="markerLink" href="'+link+'">View Details &rarr;</a><div class="markerTotal">'+i+' / <span></span></div></div></div>');
              jQuerybutton.mouseover(function(){
                  jQuerythis.gmap3({
                    action:'panTo',
                    args:[marker.position]
                  });
                  jQuery("#target").stop(true,true).fadeIn(1200).delay(500).fadeOut(1200);
               });
              jQuery('#markers').append(jQuerybutton);
              var numbers = jQuery(".markerInfo").length;
              jQuery(".markerTotal span").html(numbers);
              if(i == 1){
               jQuery('.marker:first-child').addClass('activeMarker').mouseover();
              }
              jQuerythis.gmap3({
               action:'addOverlay',
               content: '<div id="markerTitle'+i+'" class="markerTitle">'+title+'</div>',
               latLng: marker.getPosition()
               });
            }    
          });
        }
});
//]]>
</script>

Linha 4

Código: (javascript) [Seleccione]
var zoomLevel = 3,
Adequa ao valor que quiseres.

Linha 42

Acrescenta uma linha:

Código: (javascript) [Seleccione]
action: 'setOptions', args:[{
center: [38.81831, -8.31115],

Onde center é um vector com as coordenadas do ponto onde queres centrar o mapa.

Verifica o comportamento, tenho algumas dúvidas em relação às "bounds" do mapa. Nunca trabalhei com esta API e não a fui ler, mas experimenta.
Offline

Rogério Moreira 
Editor
Mensagens 1313 Gostos 11
Feedback +15

Troféus totais: 32
Trófeus: (Ver todos)
Level 6 Tenth year Anniversary Nineth year Anniversary Eighth year Anniversary Super Combination Combination Topic Starter 10 Poll Votes Poll Voter Poll Starter

Não funcionou diogo  :-(, mas mesmo assim muito obrigado pela ajuda :!:

Acho que já encontrei uma solução, mudo o zoom level no painel do tema e depois ao adicionar novos pontos no mapa ele fixa-se no primeiro que eu colocar logo se colocar só em portugal fica em portugal.