Commit 0e0f053 1 parent 5a76111 commit 0e0f053 Copy full SHA for 0e0f053
File tree 3 files changed +13
-7
lines changed
3 files changed +13
-7
lines changed Original file line number Diff line number Diff line change 54
54
$ callback = $ _GET ['callback ' ];
55
55
$ clat = (float )$ _GET ['clat ' ];
56
56
$ clon = (float )$ _GET ['clon ' ];
57
+ $ mob = (isset ($ _GET ['mobile ' ]) ? (bool )$ _GET ['mobile ' ] : false );
57
58
$ scat = (isset ($ _GET ['scat ' ]) ? (bool )$ _GET ['scat ' ] : false );
58
59
59
60
if (!db_connect ())
108
109
$ ap ['options ' ]['iconColor ' ] = '#FF1E1E ' ;
109
110
}
110
111
111
- $ ap ['properties ' ]['hintContent ' ] = '' ;
112
+ $ propContent = ($ mob ? 'balloonContent ' : 'hintContent ' );
113
+ $ ap ['properties ' ][$ propContent ] = '' ;
112
114
if (!empty ($ cluster ['bssids ' ]))
113
115
{
114
116
$ hints = array ();
138
140
$ hints [] = implode ('<br> ' , $ aphint );
139
141
}
140
142
}
141
- $ ap ['properties ' ][' hintContent ' ] = implode ('<hr> ' , $ hints );
143
+ $ ap ['properties ' ][$ propContent ] = implode ('<hr> ' , $ hints );
142
144
}
143
145
$ json ['data ' ]['features ' ][] = $ ap ;
144
146
}
Original file line number Diff line number Diff line change 17
17
18
18
var showaps = settingsGetBool ( '3wifi.map.showaps' , true ) ;
19
19
var clusters = settingsGetBool ( '3wifi.map.clusters' , true ) ;
20
+ var mob = isMobile ( ) ;
21
+ if ( mob ) myTileUrl += '&mobile=1' ;
20
22
if ( ! clusters ) myTileUrl += '&scat=1' ;
21
23
22
24
remoteObjectManager = new ymaps . RemoteObjectManager ( myTileUrl ,
23
25
{ // Разбивать запросы по тайлам
24
26
splitRequests : false ,
25
27
// Опции кластеров задаются с префиксом cluster.
26
28
clusterHasBalloon : false ,
27
- clusterHasHint : true ,
29
+ clusterHasHint : ! mob ,
28
30
// Опции объектов задаются с префиксом geoObject
29
- geoObjectOpenBalloonOnClick : false
31
+ geoObjectOpenBalloonOnClick : mob
30
32
} ) ;
31
33
32
- userLocations = new ymaps . RemoteObjectManager ( 'user.php?a=mylocmap&bbox=%b' ,
34
+ userLocations = new ymaps . RemoteObjectManager ( 'user.php?a=mylocmap&bbox=%b' + ( mob ? '&mobile=1' : '' ) ,
33
35
{ // Разбивать запросы по тайлам
34
36
splitRequests : false ,
35
37
// Опции объектов задаются с префиксом geoObject
36
- geoObjectOpenBalloonOnClick : false
38
+ geoObjectOpenBalloonOnClick : mob
37
39
} ) ;
38
40
39
41
if ( ProfileInfo . Level >= 1 )
Original file line number Diff line number Diff line change @@ -592,6 +592,7 @@ function getFloatCoord($coord)
592
592
$ lat2 = (float )$ bbox [2 ];
593
593
$ lon2 = (float )$ bbox [3 ];
594
594
$ callback = $ _GET ['callback ' ];
595
+ $ mob = (isset ($ _GET ['mobile ' ]) ? (bool )$ _GET ['mobile ' ] : false );
595
596
$ uid = $ UserManager ->uID ;
596
597
if (!$ res = QuerySql ("SELECT latitude,longitude,comment FROM locations WHERE uid= $ uid AND latitude BETWEEN $ lat1 AND $ lat2 AND longitude BETWEEN $ lon1 AND $ lon2 " ))
597
598
{
@@ -606,12 +607,13 @@ function getFloatCoord($coord)
606
607
$ loc ['type ' ] = 'Feature ' ;
607
608
$ loc ['options ' ]['iconColor ' ] = '#00D000 ' ;
608
609
$ loc ['geometry ' ]['type ' ] = 'Point ' ;
610
+ $ propContent = ($ mob ? 'balloonContent ' : 'hintContent ' );
609
611
while ($ row = $ res ->fetch_row ())
610
612
{
611
613
$ loc ['geometry ' ]['coordinates ' ][0 ] = (float )$ row [0 ];
612
614
$ loc ['geometry ' ]['coordinates ' ][1 ] = (float )$ row [1 ];
613
615
$ loc ['id ' ] = 'loc ' .substr (md5 ($ row [0 ].$ row [1 ]), 0 , 4 );
614
- $ loc ['properties ' ][' hintContent ' ] = '<b>Локация:</b><br> ' .htmlspecialchars ($ row [2 ]);
616
+ $ loc ['properties ' ][$ propContent ] = '<b>Локация:</b><br> ' .htmlspecialchars ($ row [2 ]);
615
617
$ json ['data ' ]['features ' ][] = $ loc ;
616
618
}
617
619
$ res ->close ();
You can’t perform that action at this time.
0 commit comments