<?php

namespace web\admin\cemap;
class cemap {
    public static function json_init() {
        global $db;
        global $rsuser;
        $id = getint('id');
        $tabname = get('tab');
        $binds = array();
        $binds[] = array('id' => 'camera_123', 'name' => '摄像机123');
        $ret['binds'] = $binds;
        $ret['base'] = array('lng' => 123, 'lat' => 44);
        if (!is_array($ret['base']))
            return errjson('数据不存在');
        $csql = new \ciy\sql('zc_cemap_data');
        $csql->where('tabname', $tabname);
        $csql->where('tabid', $id);
        $ret['cemap'] = $db->getone($csql);
        if (!is_array($ret['cemap']))
            return errjson('地图未配置');
        return succjson($ret);
    }
}
