我想在数据库中保存Google地图覆盖图形状.这是我的代码.它工作得很好,但我只需要all_shapes在数据库中保存数组.
<html>
<head>
<style type="text/css">
#map, html, body
{
padding: 0;
margin: 0;
height: 100%;
}
</style>
<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true&libraries=drawing,geometry"></script>
<script>
var coordinates = [];
var all_shapes = [];
var selectedShape;
</script>
<script>
function draw_shape()
{
for(var i = 0; i < all_shapes.length; i++)
{
all_shapes[i].setMap(null);
}
for(var i = 0; i < all_shapes.length; i++)
{
all_shapes[i].setMap(map);
}
}
</script>
<script>
function clearSelection()
{
if(selectedShape)
{
selectedShape.setEditable(false);
selectedShape = null;
}
}
function setSelection(shape)
{
clearSelection();
selectedShape = …Run Code Online (Sandbox Code Playgroud) 我想在MySQL的一列表中保存一个字符串.有时它是2个字符,有时甚至更大.50000个字符.用户varchar(50000)是个好主意.如果我只在列中保存2个字符,它是使用所有4998字节还是只使用2个字节?
我想通过谷歌地图实现一些东西,我需要知道setMap是否已设置或为空.我怎样才能实现这样的事情:
if (marker.setMap == null)
{
marker.setMap(map);
}
Run Code Online (Sandbox Code Playgroud)