source: trunk/Modules/Map/MapSeznam.php

Last change on this file was 11, checked in by chronos, 18 months ago
  • Fixed: IPv6 needs longer string in database.
File size: 1.1 KB
Line 
1<?php
2
3class MapSeznam extends Map
4{
5 function Geolocate($Text)
6 {
7 //new SMap.Geocoder(query, odpoved);
8 }
9
10 function Show()
11 {
12 $Output = '<div id="m" style="height:380px"></div>';
13 $Output .= '<script type="text/javascript">
14 var centerMap = SMap.Coords.fromWGS84(14.40, 50.08);
15var m = new SMap(JAK.gel("m"), centerMap, 16);
16var l = m.addDefaultLayer(SMap.DEF_BASE).enable();
17m.addDefaultControls();
18
19
20var nalezeno = function(route) {
21 var vrstva = new SMap.Layer.Geometry();
22 m.addLayer(vrstva).enable();
23
24 var coords = route.getResults().geometry;
25 var cz = m.computeCenterZoom(coords);
26 m.setCenterZoom(cz[0], cz[1]);
27 var g = new SMap.Geometry(SMap.GEOMETRY_POLYLINE, null, coords);
28 vrstva.addGeometry(g);
29}
30
31var coords = [
32 SMap.Coords.fromWGS84(14.434, 50.084),
33 SMap.Coords.fromWGS84(16.600, 49.195)
34];
35var route = new SMap.Route(coords, nalezeno);
36 </script>';
37 Core::Cast($this->System)->HeadItems[] = '<script src="//api.mapy.cz/loader.js"></script>
38 <script>Loader.load()</script>';
39
40 return $Output;
41 }
42}
Note: See TracBrowser for help on using the repository browser.