RicardoCostaTW 0 Posted April 12, 2013 Report Share Posted April 12, 2013 Boas Pessoal, Estou a tentar seguir estes tutoriais https://developers.google.com/maps/documentation/javascript/overlays?hl=pt-br#SimpleIcons para construir mapas, só que estou a tentar coloca-los no wordpress. O meu problema é que numa página html simples, fora do wordpress tudo funciona, agora dentro de uma página wordpress não aparece nada. O meu código é o seguinte: <?php /* Template Name: ondeEstamos */ get_header(); ?> <style> html, body, #map-canvas { margin: 0; padding: 0; height: 100%; } </style> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?sensor=false"></script> <script> var map; function initialize() { var mapOptions = { zoom: 8, center: new google.maps.LatLng(-34.397, 150.644), mapTypeId: google.maps.MapTypeId.ROADMAP }; map = new google.maps.Map(document.getElementById('map-canvas'), mapOptions); } google.maps.event.addDomListener(window, 'load', initialize); window.onload = initialize(); </script> <div id="primary"> <div id="map-canvas"></div> </div> <?php get_footer(); ?> Alguém sabe porque? Obrigado Link to post Share on other sites
RicardoCostaTW 0 Posted April 12, 2013 Author Report Share Posted April 12, 2013 Não aparece nada além do cabeçalho e do rodapé. :X Link to post Share on other sites
Rui Carlos 359 Posted April 12, 2013 Report Share Posted April 12, 2013 Usaste as ferramentas de desenvolvimento do browser para fazer debug? Tens isso online? Rui Carlos Gonçalves Link to post Share on other sites
RicardoCostaTW 0 Posted April 13, 2013 Author Report Share Posted April 13, 2013 Não usei ferramentes realmente. Mas é estranho não aparecer nada. Link to post Share on other sites
Rui Carlos 359 Posted April 13, 2013 Report Share Posted April 13, 2013 A maior parte dos browsers já vem com as ferramentas de desenvolvimento incluídas. Num clique obténs informação que te pode ser bastante útil. Ou então, se tiveres o site online, coloca aqui o link. 1 Report Rui Carlos Gonçalves Link to post Share on other sites
RicardoCostaTW 0 Posted April 13, 2013 Author Report Share Posted April 13, 2013 (edited) Ola Rui, agradeço a tua disponibilidade para me ajudar. O link é este http://www.tecnologias.in/prioenergy/?page_id=30 Obrigado Edited April 13, 2013 by RicardoCostaTW Link to post Share on other sites
Rui Carlos 359 Posted April 13, 2013 Report Share Posted April 13, 2013 Há um erro de Javascript, referente a valores que não estão definidos. Pelo que vi na net, pode ser por não teres dimensões na div que vai conter o mapa. Experimenta adicionar style="height: yy px; width: xx px" na div. 1 Report Rui Carlos Gonçalves Link to post Share on other sites
RicardoCostaTW 0 Posted April 14, 2013 Author Report Share Posted April 14, 2013 (edited) Já experimentei e não dá nada :X Afinal dá, estava a passar os ficheiros para o directório errado. Faltava a altura e a largura como disseste. Muito obrigado Edited April 14, 2013 by brunoais 2x post junto Link to post Share on other sites
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now