It worked fine for me after I fixed three typos: change "," to ";" at end of lines 1, 2, and also the 2nd to last line. You've also got an extraneous comma at the end of the height: "auto" line which will causes problems with some browsers.
Gary On Jan 27, 2:19 pm, velomash <[email protected]> wrote: > Hey guys, > > I LOVE infobox. It's so helpful in my map applications. So cheers to > all the contributors. > > I'd love to be able to use Nodes for my content instead of strings, > but I haven't been getting it to work. > > Here's the code that doesn't work. The obj is a JSON obj that has some > values stored in it. This code prints "[object HTMLDivElement]" as the > InfoBox content. > > var regionName = document.createElement('div'), > regionMarkerText = document.createElement('div'), > regionPosition = new google.maps.LatLng( > obj["latLng"]["lat"], > obj["latLng"]["lng"] > ); > regionName.className = "region-name"; > regionName.innerText = obj["name"]; > regionMarkerText.className = "region-marker-text"; > regionMarkerText.appendChild(regionName); > var options = { > content: regionMarkerText, > boxStyle: { > width: "auto", > height: "auto", > }, > disableAutoPan: true, > pixelOffset: new google.maps.Size(-60, -20), > position: regionPosition, > closeBoxURL: "", > isHidden: false, > pane: "mapPane", > enableEventPropagation: true > }, > label = new InfoBox(options); -- You received this message because you are subscribed to the Google Groups "Google Maps JavaScript API v3" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/google-maps-js-api-v3?hl=en.
