Commits

Hideya OHASHI committed 69105a9

support plus sign for DoCoMo GPS

Comments (0)

Files changed (1)

src/com/appspot/ktai4sq/VenuesServlet.scala

       }
       resp.sendRedirect("%s?l=%f,%f".format(url, pos3(0), pos3(1)))
     }
-    val lat = req.getParameter("lat")
+    val latpre = req.getParameter("lat")
+    val lat = if (latpre.charAt(0) == '+') latpre.substring(1) else latpre
     if ((au || docomo) && lat != null) {
-      val lon = req.getParameter("lon")
+      val lonpre = req.getParameter("lon")
+      val lon = if (lonpre.charAt(0) == '+') lonpre.substring(1) else lonpre
       val pos2 = List(lat, lon).map(_.split("\\.")).map(_.map(_.toInt))
       val pos3 = pos2.map { x =>
         x(0) + x(1) / 60.0 + "%d.%d".format(x(2), x(3)).toDouble / (60 * 60)