Page 1 of 1

infobox

Posted: Wed Apr 02, 2014 3:20 pm
by laura6372139

hi:

I have this code:

var myOptions = {
zoom :14,
center: new google.maps.LatLng(49.47216, -123.76307),
mapTypeId: google.maps.MapTypeId.ROADMAP
};

var map = new google.maps.Map($('div[dsid="googlemap_1"]').get(0), myOptions);

var marker = new google.maps.Marker({
map: map,
draggable: true,
position: new google.maps.LatLng(49.47216, -123.76307),
visible: true
});

Code: Select all

     var boxText = document.createElement("div"); 
     boxText.style.cssText = "border: 1px solid black; margin-top: 8px; background: yellow; padding: 5px;"; 
     boxText.innerHTML = "City Hall, Sechelt

British Columbia
Canada";

var myoptions1= {
content: boxText,
disableAutoPan: false,
maxWidth: 0,
pixelOffset: new google.maps.Size(-140, 0),
zIndex: null,
boxStyle: {
background: "url('tipbox.gif') no-repeat",
opacity: 0.75,
width: "280px"},
closeBoxMargin: "10px 2px 2px 2px",
closeBoxURL: "http://www.google.com/intl/en_us/mapf...",
infoBoxClearance: new google.maps.Size(1, 1),
isHidden: false,
pane: "floatPane",
enableEventPropagation: false,
};

var ib = new InfoBox(myoptions1);

google.maps.event.addListener(marker, 'click', function() {
ib.open(map, marker);
});

http://google-maps-utility-library-v3...

This doesn't work!

I have errors in the consola: Image

but I've tried different codes and I get the same result.

can you help me?

thanks!!


infobox

Posted: Wed Apr 02, 2014 4:39 pm
by Maryna Brodina

Hello!
Be sure to include infobox.js or infobox_packed.js. Create new JS asset using this file https://code.google.com/p/google-maps...


infobox

Posted: Wed Apr 02, 2014 4:57 pm
by laura6372139

thanks Maryna!!!