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 |
|
---|
3 | class 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);
|
---|
15 | var m = new SMap(JAK.gel("m"), centerMap, 16);
|
---|
16 | var l = m.addDefaultLayer(SMap.DEF_BASE).enable();
|
---|
17 | m.addDefaultControls();
|
---|
18 |
|
---|
19 |
|
---|
20 | var 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 |
|
---|
31 | var coords = [
|
---|
32 | SMap.Coords.fromWGS84(14.434, 50.084),
|
---|
33 | SMap.Coords.fromWGS84(16.600, 49.195)
|
---|
34 | ];
|
---|
35 | var 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.