Update Google Map to V3

Update Google Map to V3


Google recently updated Google Map to v3. Please follow the steps below to upgrade your store to Google Map v3:

1. Open shopgooglemap.asp and locate the following code:

Sub Displaygooglemap
2. Replace it with the following code:

Sub Displaygooglemap
'702 - 2012.09.28 - Enhancement: Upgrade Google Map to V3
GoogleMapV3
3. Locate the following code:

</script>
<h2><%=getlang("langgooglemap")%>
4. Replace with the following code:

</script>
<h2><%=getlang("langgooglemap")%></h2>
<div id="contactgooglemap" class="ac">
<div id="googlemap" style="width: <%=strwidth%>px; height: <%=strheight%>px"></div>
</div>
<%
end if
end sub

'702 - 2012.09.28 - Enhancement: Upgrade Google Map to V3
sub GoogleMapV3
if getconfig("xgooglemap")<>"Yes" then exit sub
if getconfig("xgooglemaplatitude")="" or isnull(getconfig("xgooglemaplatitude")) then exit sub
if getconfig("xgooglemaplongitude")="" or isnull(getconfig("xgooglemaplongitude")) then exit sub
dim strlat
dim strlng
dim strzoomlevel
dim strwidth
dim strheight

strlat = getconfig("xgooglemaplatitude")
strlng = getconfig("xgooglemaplongitude")
strzoomlevel = getconfig("xgooglemapzoomlevel")
strwidth = getconfig("xgooglemapwidth")
strheight = getconfig("xgooglemapheight")

'set width and height of map to default value 300x300 if strwidth and strheight fields value is empty
if strwidth = "" or isnull(strwidth) then strwidth = 500
if strheight = "" or isnull(strheight) then strheight = 300

'set zoom level to default value 15 if strzoomlevel field value is empty
if strzoomlevel = "" or isnull(strzoomlevel) then strzoomlevel = 4

'display google map if latitude and longitude coordinate is not empty to start draw the map
if strlat <> "" and strlng <> "" then
%>
<script src="https://maps.googleapis.com/maps/api/js?sensor=false"></script>
<script>
var stockholm = new google.maps.LatLng(<%=strlat%>, <%=strlng%>);
var parliament = new google.maps.LatLng(<%=strlat%>, <%=strlng%>);
var marker;
var map;
function initialize() {
var mapOptions = {
zoom: <%=strzoomlevel%>,
center: stockholm,
mapTypeId: google.maps.MapTypeId.ROADMAP
};
map = new google.maps.Map(document.getElementById('googlemap'), mapOptions);

marker = new google.maps.Marker({
map:map,
draggable:true,
animation: google.maps.Animation.DROP,
position: parliament
});
google.maps.event.addListener(marker, 'click', toggleBounce);
}

function toggleBounce() {

if (marker.getAnimation() != null) {
marker.setAnimation(null);
} else {
marker.setAnimation(google.maps.Animation.BOUNCE);
}
}
google.maps.event.addDomListener(window, 'load', initialize);
</script>
<h2><%=getlang("langgooglemap")%></h2>
5. Save the the changes and update to your site for the changes to take effect.


Times Viewed:
3152
Added By:
anggar
Date Created:
10/4/2012
Last Updated:
10/4/2012