Skip to content
This repository has been archived by the owner on Jul 27, 2023. It is now read-only.

non-geographical map #53

Open
metisar opened this issue Dec 2, 2021 · 1 comment
Open

non-geographical map #53

metisar opened this issue Dec 2, 2021 · 1 comment

Comments

@metisar
Copy link

metisar commented Dec 2, 2021

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
Copy link
Author

metisar commented Dec 10, 2021

`<?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:

`

<script>jQuery(function ($) { --   | function map_init(){   | var map = L.map('w0', {"crs":"L.CRS.Simple","minZoom":-8,"maxZoom":2});   | L.imageOverlay('http://localhost/img/gvrt1.png', L.latLngBounds([24500,-12700], [-24500,233700]), {}).addTo(map);   | map.fitBounds([24500, -12700], [-24500, 233700]);}   | map_init();   | });</script> `

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant