php_app/app/views/portlets/render_public/_mapcontent.html.haml
Nicolas Bally 5cf3a3e83d initial
2014-11-25 22:56:20 +01:00

64 lines
1.1 KiB
Plaintext

#map_content_map.map_content_map{:id => input.id, :style => "width:100%; height:400px;margin:auto;"}
<script type="text/javascript">
="var address ='#{escape_javascript(input.address.to_s)}';"
var geocoder;
geocoder = new google.maps.Geocoder();
geocoder.geocode( { 'address': address}, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
var myLatlng = results[0].geometry.location;
var myOptions = {
="zoom:#{escape_javascript(input.zoom.to_s)},"
center: myLatlng,
-if input.view == 1
mapTypeId: google.maps.MapTypeId.ROADMAP
-elsif input.view == 2
mapTypeId: google.maps.MapTypeId.HYBRID
-elsif input.view == 3
mapTypeId: google.maps.MapTypeId.SATELLITE
};
="var map = new google.maps.Map(document.getElementById('map_content_map_#{input.id}'),"
myOptions);
var marker = new google.maps.Marker({
position: myLatlng,
map : map,
="title:'=#{escape_javascript(input.name)}',"
});
var infowindow = new google.maps.InfoWindow({
="content:'#{escape_javascript(input.name)}',"
});
-if input.info_bule
infowindow.open(map,marker);
}
});
</script>