Hi!
I load "runjavascritp" this code in the screen "prueba".
var cityList = [
['Chicago', 41.850033, -87.6500523, 1],
['Illinois', 40.797177,-89.406738, 2]
];
Code: Select all
var demoCenter = new google.maps.LatLng(41,-87);
var boxList =[];
function initialize() {
map = var map = Appery("googlemap_1").gmap;, {
zoom: 7,
center: demoCenter,
mapTypeId: google.maps.MapTypeId.ROADMAP
});
addMarkers();
}
function addMarkers(){
for (var i = 0; i < cityList.length; i++)
{
marker = new google.maps.Marker({
position: new google.maps.LatLng(cityList[i][1], cityList[i][2]),
map: map,
id: i,
title: cityList[i][0]
});
var boxText = document.createElement("div");
boxText.id = i;
boxText.style.cssText = "border: 1px solid black; margin-top: 8px; background: yellow; padding: 5px;";
boxText.innerHTML = "InfoBox for " + cityList[i][0];
var myOptions = {
content: boxText
,disableAutoPan: false
,maxWidth: 0
,pixelOffset: new google.maps.Size(-140, 0)
,zIndex: null
,boxStyle: {
background: "url('[url=https://api.appery.io/rest/1/db/files/52810bdfe4b047690d3b713d/aaf6dbff-d0d6-4820-b003-8df18b917cd2.PueblosdeBenicadell.jpg]https://api.appery.io/rest/1/db/files...[/url]') no-repeat"
,opacity: 0.75
,width: "280px"
}
,closeBoxMargin: "10px 2px 2px 2px"
,closeBoxURL: "[url=http://www.google.com/intl/en_us/mapfiles/close.gif]http://www.google.com/intl/en_us/mapf...[/url]"
,infoBoxClearance: new google.maps.Size(1, 1)
,isHidden: false
,pane: "floatPane"
,enableEventPropagation: false
};
var ib = new InfoBox(myOptions);
boxList.push(ib);
google.maps.event.addListener(marker,'click',(function(marker, i) {
return function() {
boxList[i].open(map, this);
}
})(marker, i));
google.maps.event.addDomListener(boxList[i].content_,'click',(function(marker, i) {
return function() {
window.location.replace("[url=http://stackoverflow.com]http://stackoverflow.com[/url]");
}
})(marker, i));
} //endfor
} //end function
This code in dreamweaver works well, but in appery it don't work.
Can you help me?
Thanks!