2amigos / yii2-leaflet-extension

Yii 2 Extension library to display interactive maps with Leaflet .
http://yiiwheels.com
Other
30 stars 26 forks source link

non-geographical map #53

Open metisar opened 2 years ago

metisar commented 2 years ago

Hello there, I want to show a non-geographical map on my page, but I couldn't do it. I would be very grateful if you could help me with an example.

metisar commented 2 years ago

`<?php

use yii\helpers\Html; use yii\widgets\DetailView; use dosamigos\leaflet\types\LatLng; use dosamigos\leaflet\types\Bounds; use dosamigos\leaflet\types\Point; use dosamigos\leaflet\types\LatLngBounds; use dosamigos\leaflet\controls;

$bounds = new LatLngBounds( [ 'southWest' => new LatLng(['lat' => 24500, 'lng' => -12700]), 'northEast' => new LatLng(['lat' => -24500, 'lng' => 233700]) ] );

$overlay = new \dosamigos\leaflet\layers\ImageOverlay([ 'imageBounds' => $bounds, 'imageUrl' => 'http://localhost/img/gvrt1.png' ]);

$leaflet = new \dosamigos\leaflet\LeafLet([

    'center'=>  new LatLng(['lat' => 0, 'lng' => 0]),
    'zoom' => 2,
    'clientOptions' => [
    'bounds' => '[24500, -12700], [-24500, 233700]', 
    'crs'=> 'L.CRS.Simple',
    'minZoom'=> -8,
    'maxZoom'=> 2,
],  

]); $leaflet->addLayer($overlay); echo \dosamigos\leaflet\widgets\Map::widget(['leafLet' => $leaflet]); ?>`

where am i doing wrong. Can someone help please. the output is like this:

`

`