Вот мое js-событие
Код: Выделить всё
function AddNext(event)
{
MQA.EventManager.addListener(map, 'click', AddNext);
var lata = event.ll.getLatitude();
var lnga = event.ll.getLongitude();
var latlon=lata+"|"+lnga;
addpasslatlon(latlon);
MQA.EventManager.clearAllListeners( map);
exit();
};
Код: Выделить всё
function addpasslatlon(latlon)
{
var value=latlon;
$.ajax({
url:'insertPos',
type:'POST',
data:value,
success : function(data){
alert('success'+data);
}
});
}
Код: Выделить всё
public class InsertPos extends HttpServlet {
private static final long serialVersionUID = 1L;
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException
{
response.setContentType("text/html;charset=UTF-8");
PrintWriter out = response.getWriter();
String a =request.getParameter("value");
System.out.println(a);
}
}
Код: Выделить всё
/insertPos
null
Подробнее здесь: https://stackoverflow.com/questions/291 ... to-servlet
Мобильная версия