Jump to content

html σε σελιδα cms


Recommended Posts

καλησπερα, θα ηθελα να ρωτησω αν γινετε να βαλουμε χαρτη google σε μια σελιδα cms, γιατι ενω βαζω τον html κωδικο του χαρτη δεν εμφανιζετε τιποτα γιατι?
ευχαριστω

Link to comment
Share on other sites

καλησπερα, θα ηθελα να ρωτησω αν γινετε να βαλουμε χαρτη google σε μια σελιδα cms, γιατι ενω βαζω τον html κωδικο του χαρτη δεν εμφανιζετε τιποτα γιατι?
ευχαριστω


ναι γίνετε.

βάλε αυτό το κώδικα στο contact-form.tpl


<!-- Google Maps code start -->
{literal}
[removed][removed]





JavaScript must be enabled in order for you to use Google Maps. 
     However, it seems JavaScript is either disabled or not supported by your browser. 
     To view Google Maps, enable JavaScript by changing your browser options, and then 
     try again.



   [removed]
   //<![CDATA[

function display_map()
{

   if (GBrowserIsCompatible()) { 

     // A function to create the marker and set up the event window
     // Dont try to unroll this function. It has to be here for the function closure
     // Each instance of the function preserves the contends of a different instance
     // of the "marker" and "html" variables which will be needed later when the event triggers.    

     html ="Auto-View
Megaloupoleos 16 street
Agios Dimitrios
Phone: +30212 1002079<\/div>";

     function createMarker(point,html) {
       var marker = new GMarker(point);
       GEvent.addListener(marker, "click", function() {
         marker.openInfoWindowHtml(html);
       });
       return marker;
     }

     // Display the map, with some controls and set the initial location 
     var map = new GMap2(document.getElementById("map"));
     map.addControl(new GSmallMapControl());
     map.addControl(new GMapTypeControl());
     map.setCenter(new GLatLng(37.938186,23.738931),16);

     // Set up the marker and info

     var point = new GLatLng(37.938186,23.738931);
     var marker = createMarker(point, html)
     map.addOverlay(marker);
     marker.openInfoWindowHtml(html);


   }
   GDownloadUrl("markers.xml", function(data) {
         var xml = GXml.parse(data);
         var markers = xml.documentElement.getElementsByTagName("marker");
         for (var i = 0; i < markers.length; i++) {
           var name = markers[i].getAttribute("name");
           var label = markers[i].getAttribute("label");
           var desc = markers[i].getAttribute("desc");
           var address = markers[i].getAttribute("address");
           var type = markers[i].getAttribute("type");
           var icona = markers[i].getAttribute("icona");
           var point = new GLatLng(parseFloat(markers[i].getAttribute("lat")),
                                   parseFloat(markers[i].getAttribute("lng")));
           var marker = createMarker(point, name, label, desc,  address, type, icona);
           map.addOverlay(marker);
         }

   // display a warning if the browser was not compatible
   else {
     alert("Sorry, the Google Maps API is not compatible with this browser");
   }

   // This Javascript is based on code provided by the
   // Community Church Javascript Team
   // http://www.bisphamchurch.org.uk/   
   // http://econym.org.uk/gmap/

   //]]>

}
[removed]
{/literal}

{literal}
[removed]
window.onload= function(){
 display_map();
};

window.onunload= function(){
 GUnload();
};
[removed] 
{/literal}

<!-- Google Maps code end -->

Link to comment
Share on other sites

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...