Beispiel #1
0
 public function registerScripts()
 {
     MapPopupAsset::register($this->getView());
     $latitude = TimsHelper::convertDMSToDecimal($this->latitude);
     $longitude = TimsHelper::convertDMSToDecimal($this->longitude);
     $this->getView()->registerJs("\n            var myCenter = new google.maps.LatLng(\"{$latitude}\", \"{$longitude}\");\n\n            function initialize()\n            {\n                var mapProp = {\n                    center:myCenter,\n                    zoom:5,\n                    mapTypeId:google.maps.MapTypeId.ROADMAP\n                };\n                var map=new google.maps.Map(document.getElementById(\"googleMap\"),mapProp);\n                var marker=new google.maps.Marker({\n                    position:myCenter,\n                });\n                marker.setMap(map);\n                var infowindow = new google.maps.InfoWindow({\n                    content: 'Place Location'\n                });\n                infowindow.open(map,marker);\n            }\n\n            jQuery(function(){\n                \$('#{$this->modalId}').on('shown.bs.modal', function () {\n                    initialize();\n                });\n            });\n        ", View::POS_END, 'my-options');
 }
Beispiel #2
0
<?php

/*
 *
 */
use app\helpers\TimsHelper;
$this->registerJs("function initialize_{$model->id}()\n    {\n\n        var myCenter=new google.maps.LatLng(" . TimsHelper::convertDMSToDecimal($model->lat) . "," . TimsHelper::convertDMSToDecimal($model->lng) . ");\n\n        var mapProp = {\n            center:myCenter,\n            zoom:9,\n            mapTypeId:google.maps.MapTypeId.ROADMAP\n        };\n\n        var map=new google.maps.Map(document.getElementById(\"google-map-{$model->id}\"),mapProp);\n\n        var marker=new google.maps.Marker({\n            position:myCenter,\n        });\n\n        marker.setMap(map);\n    }\n\n    google.maps.event.addDomListener(window, 'load', initialize_{$model->id});", \yii\web\View::POS_END, 'google-map-' . $model->id);
?>

<div class="print-record">

    <div class="head">
        CLARK COUNTY SCHOOL DISTRICT<br>
        TRANSPORATION DEPARTMENT<br>
        4499 Arville St.<br>
        Las Vegas, NV 89103<br>
        Stop Arm Violation<br>
        NRS 484.357
    </div>
    <br>
    <div>
        <span
            class="bold">Date Time:</span>  <?php 
echo Yii::$app->formatter->asDatetime("{$model->infraction_date}", "php:d-m-Y H:i:s");
?>
</span>
        <br/>
        <span class="bold">License Plate Number:</span> <?php 
echo $model->license;
?>
        <br/>