mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
23407ebd50
commit
8adf3b2e4b
@ -4,7 +4,7 @@ Volcanos("user", {
|
|||||||
scanQRCode: function(can, cb) { can.user.input(event, can, [{type: html.TEXTAREA, name: mdb.TEXT, text: ""}], function(list) { cb(can.base.ParseJSON(list[0])) }) },
|
scanQRCode: function(can, cb) { can.user.input(event, can, [{type: html.TEXTAREA, name: mdb.TEXT, text: ""}], function(list) { cb(can.base.ParseJSON(list[0])) }) },
|
||||||
getLocation: function(can, cb) { var call = arguments.callee; if (call._res) { return cb(call._res) }
|
getLocation: function(can, cb) { var call = arguments.callee; if (call._res) { return cb(call._res) }
|
||||||
navigator.geolocation.getCurrentPosition(function(res) {
|
navigator.geolocation.getCurrentPosition(function(res) {
|
||||||
cb(call._res = {type: "ip", name: "当前位置", text: "某某大街", latitude: res.coords.latitude, longitude: res.coords.longitude})
|
cb(call._res = {type: "ip", name: "当前位置", text: "某某大街", latitude: res.coords.latitude.toFixed(6), longitude: res.coords.longitude.toFixed(6)})
|
||||||
}, function(some) { can.base.isFunc(cb) && cb({type: "location", name: "北京市", text: "天安门", latitude: 39.98412, longitude: 116.30748}) } )
|
}, function(some) { can.base.isFunc(cb) && cb({type: "location", name: "北京市", text: "天安门", latitude: 39.98412, longitude: 116.30748}) } )
|
||||||
},
|
},
|
||||||
openLocation: function(can, msg) {
|
openLocation: function(can, msg) {
|
||||||
|
@ -184,7 +184,7 @@ Volcanos(chat.ONACTION, {list: [["mode", mdb.SELECT, mdb.INSERT],
|
|||||||
pitch: function(event, can) { can.map.setPitch(can.Action("pitch")) },
|
pitch: function(event, can) { can.map.setPitch(can.Action("pitch")) },
|
||||||
rotation: function(event, can) { can.map.setRotation(can.Action("rotation")) },
|
rotation: function(event, can) { can.map.setRotation(can.Action("rotation")) },
|
||||||
_point: function(event, can, item) { var rect = can.ui.content.getBoundingClientRect()
|
_point: function(event, can, item) { var rect = can.ui.content.getBoundingClientRect()
|
||||||
return can.base.Copy({left: rect.left+event.point.x, bottom: rect.top+event.point.y, latitude: event.latLng.lat, longitude: event.latLng.lng}, item, true)
|
return can.base.Copy({left: rect.left+event.point.x, bottom: rect.top+event.point.y, latitude: event.latLng.lat.toFixed(6), longitude: event.latLng.lng.toFixed(6)}, item, true)
|
||||||
},
|
},
|
||||||
center: function(can, item) { var point = can.onimport.point(can, item); can.map.setCenter(point); if (!item.name) { return }
|
center: function(can, item) { var point = can.onimport.point(can, item); can.map.setCenter(point); if (!item.name) { return }
|
||||||
can.current.item = item, can.Status(mdb.NAME, ""), can.Status(mdb.TEXT, ""), can.Status(item), can.Status({latitude: point.lat, longitude: point.lng})
|
can.current.item = item, can.Status(mdb.NAME, ""), can.Status(mdb.TEXT, ""), can.Status(item), can.Status({latitude: point.lat, longitude: point.lng})
|
||||||
|
Loading…
x
Reference in New Issue
Block a user