Search Results

Search found 2 results on 1 pages for 'infobubble'.

Page 1/1 | 1 

  • Google Maps InfoBubble pixelOffset

    - by Sam
    I am trying to implement a custom infoBubble that has the box opening to the side of a marker. This has turned out to be harder than expected. Using the normal infoWindow you can use pixelOffset. See here for the documentation Using infoBubble this does not seem to be the case. Is there anyway of using pixelOffset in an infoBubble, or something that will do the same thing? I have found this very difficult to search for, as using a google search such as this returns no relevant results Google Search Below is all my resources I have been using. Example of infoBubble here. My JavaScript to setup the map and infoBubble here. And now my javascript here just in-case the jsfiddle link is broken. <script type="text/javascript"> $(document).ready(function () { init(); }); function init() { //Setup the map var googleMapOptions = { center: new google.maps.LatLng(53.5167, -1.1333), zoom: 13, mapTypeId: google.maps.MapTypeId.ROADMAP }; //Start the map var map = new google.maps.Map(document.getElementById("map_canvas"), googleMapOptions); var marker = new google.maps.Marker({ position: new google.maps.LatLng(53.5267, -1.1333), title: "Just a test" }); marker.setMap(map); infoBubble = new InfoBubble({ map: map, content: '<div class="phoneytext">Some label</div>', //position: new google.maps.LatLng(-35, 151), shadowStyle: 1, padding: '10px', //backgroundColor: 'rgb(57,57,57)', borderRadius: 5, minWidth: 200, arrowSize: 10, borderWidth: 1, borderColor: '#2c2c2c', disableAutoPan: true, hideCloseButton: false, arrowPosition: 7, backgroundClassName: 'phoney', pixelOffset: new google.maps.Size(130, 120), arrowStyle: 2 }); infoBubble.open(map, marker); } </script>

    Read the article

  • Mapstraction: Changing an Icon's image URL after it has been added?

    - by Paul Owens
    I am trying to use marker.setIcon() to change a markers image. However it appears that although this changes the marker.iconUrl attribute the icon itself is using marker.proprietary_marker.$.icon.image to display the markers image - so the markers icon remains unchanged. Is there a way to dynamically change the marker.proprietary_marker.$.icon.image? Add a marker. Check the icon's image url and the proprietary icon's image - they're the same. Change the icon. Again check the Urls. Now the Icon Url has changed but the marker still shows the old image which is in the proprietary marker object. <head> <title>Map Test</title> <script src="http://maps.google.com/maps?file=api&v=2&key=Your-Google-API-Key" type="text/javascript"></script> <script src="mapstraction.js"></script> <script type="text/javascript"> var map; var marker; function getMap(){ map = new mxn.Mapstraction('myMap','google'); map.setCenterAndZoom(new mxn.LatLonPoint(45.559242,-122.636467), 15); } function addMarker(){ marker = new mxn.Marker(new mxn.LatLonPoint(45.559242, -122.636467)); marker.addData({infoBubble : "Text", label : "Label", marker : 4, icon: "http://mapscripting.com/examples/mashups/richter-high.png"}); map.addMarker(marker); } function changeIcon(){ marker.setIcon("http://assets1.mapufacture.com/images/markers/usgs_marker.png"); } function showIconURL(){ alert(marker.iconUrl); } function showProprietaryIconURL(){ alert(marker.proprietary_marker.$.icon.image); } </script> </head> <body onload="getMap()"> <div id="myMap" style="width:627px; height:412px;"></div> <div> <input type="button" value="add marker" OnClick="addMarker();"> <input type="button" value="change icon" OnClick="changeIcon();"> <input type="button" value="show icon URL" OnClick="showIconURL();"> <input type="button" value="show proprierty icon URL " OnClick="showProprietaryIconURL();"> </div> </body> </html>

    Read the article

1