I'm using the google map javascript api (v3). I have a google map in one of 
my views.  I want to display the location name as the marker title (used 
when hovering over the marker).  I'm using the following code in my view:
 
<script type="text/javascript">
    function init_map() {
        var myLatlng = new google.maps.LatLng({{=myobject.lat}}, {{=myobject
.lng}});
        var mapOptions = {
            center: myLatlng,
            zoom: 12,
            mapTypeId: google.maps.MapTypeId.ROADMAP
            };
        var map = new google.maps.Map(document.getElementById("map-canvas"),
            mapOptions);
        var marker = new google.maps.Marker({
            position: myLatlng,
            map: map,
            title: "{{=myobject.name}}"
            });
    }
    google.maps.event.addDomListener(window, 'load', init_map);
</script>

 
This works to output a map but when I mouse over the marker, the character 
encoding is not right.  For example, if  myobject.name contains the string 
"John's Place" then the marker tooltip will literally display "John&#x27;s 
Place" (that is, with the ampersand and hash).  How can I get it to display 
the string as "John's Place" in a web safe manner?
 

 

-- 
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
--- 
You received this message because you are subscribed to the Google Groups 
"web2py-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to web2py+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to