if(location){ var value = $.trim(location); var point = value.split(','); options.lat = parseFloat(point[0]); options.long= parseFloat(point[1]); options.zoom = parseFloat(point[2]); };
var center =new google.maps.LatLng(options.lat, options.long);
var map =new google.maps.Map(this.get(0), $.extend(options,{ center: center }));
var storeMarker =new google.maps.Marker({ position: center, map: map }); }; </script>
I just test your code on a fresh Umbraco 6.0.6, and I works just fine. You´re just missing a very small part. To get the map visible on the front you need to added a width and a height on the map container div, could be by css or just by adding the width and the height on the div by using the style attribut.
Google maps datatype not working
Hello. I downloaded google maps datatype v. 2.1.0. I am using Umbraco version 6.0.6
I am trying to display google maps, so I can put pins og retrieve locations from the map, but I cannot get any map to show :(
I installed the Datatype and named it: Google Map. I can see it in the Developer section under Data types.
I made a template and a javascript file.
Template: myTemplate
Script googleMap:
But I receive nothing at all. Any suggestions
Hi Kristoffer,
I just test your code on a fresh Umbraco 6.0.6, and I works just fine. You´re just missing a very small part. To get the map visible on the front you need to added a width and a height on the map container div, could be by css or just by adding the width and the height on the div by using the style attribut.
The css way: inline in your head section:
Css by stylesheet:
Adding the width and height on div by using style attribute:
/Dennis
Wow, you were right. Thanks a bunch. I am still a rookie in the html/css/javascript world :)
Hi Kristoffer,
Great you got it working.
/Dennis
is working on a reply...