/    Sign up×
Community /Pin to ProfileBookmark

Hello

I am trying to add a map to my website, the site is provides via google maps, for some reason, it wont display, i have used this code on other sites and it works on problem, but fails on this site/server? ?

[QUOTE]

<style type=”text/css”>

div#popup {
background:#CCCCCC;
border:5px solid #00FF99;
margin:0px;
padding:7px;
width:270px;
}
</style>
<script src=”http://maps.google.com/maps?file=api&amp;v=2&amp;key=”Key removed for security”
type=”text/javascript”></script>
<script type=”text/javascript”>
var map;
var icon0;
var newpoints = new Array();

function addLoadEvent(func) {
var oldonload = window.onload;
if (typeof window.onload != ‘function’){
window.onload = func
} else {
window.onload = function() {
oldonload();
func();
}
}
}

addLoadEvent(loadMap);
addLoadEvent(addPoints);

function loadMap() {
map = new GMap2(document.getElementById(“map”));
map.addControl(new GLargeMapControl());
map.addControl(new GMapTypeControl());
map.setCenter(new GLatLng(54.899340, -3.062500), 15);
map.setMapType(G_NORMAL_MAP);

icon0 = new GIcon();
icon0.image = “http://www.thetranquilotter.co.uk/beta/marker.png”;
icon0.shadow = “http://www.thetranquilotter.co.uk/beta/shadow50.png”;
icon0.iconSize = new GSize(20, 34);
icon0.shadowSize = new GSize(37, 34);
icon0.iconAnchor = new GPoint(9, 34);
icon0.infoWindowAnchor = new GPoint(9, 2);
icon0.infoShadowAnchor = new GPoint(18, 25);

}

function addPoints() {

newpoints[0] = new Array(54.899340, -3.062500, icon0, ”, ‘Name Here’);
for(var i = 0; i < newpoints.length; i++) {
var point = new GPoint(newpoints[i][1],newpoints[i][0]);
var popuphtml = newpoints[i][4] ;
var marker = createMarker(point,newpoints[i][2],popuphtml);
map.addOverlay(marker);
}

}

function createMarker(point, icon, popuphtml) {
var popuphtml = “<div id=”popup”>” + popuphtml + “</div>”;
var marker = new GMarker(point, icon);
GEvent.addListener(marker, “click”, function() {
marker.openInfoWindowHtml(popuphtml);
});
return marker;
}
//]]>
</script>

[/QUOTE]

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@FangApr 14.2008 — &lt;div id="map" [COLOR="Green"]style="overflow:hidden;"[/COLOR]&gt;&lt;/div&gt;
×

Success!

Help @Pbrown23 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...