diff --git a/OsmAnd-java/src/net/osmand/RenderingContext.java b/OsmAnd-java/src/net/osmand/RenderingContext.java index 8e412e5a66..7d3de4aa53 100644 --- a/OsmAnd-java/src/net/osmand/RenderingContext.java +++ b/OsmAnd-java/src/net/osmand/RenderingContext.java @@ -48,6 +48,7 @@ public class RenderingContext { // be aware field is using in C++ public float screenDensityRatio = 1; + public float textScale = 1; public int shadowRenderingMode = ShadowRenderingMode.SOLID_SHADOW.value; public int shadowRenderingColor = 0xff969696; public String renderingDebugInfo; diff --git a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java index be94f3a629..b638646824 100644 --- a/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java +++ b/OsmAnd-java/src/net/osmand/binary/BinaryInspector.java @@ -1,6 +1,7 @@ package net.osmand.binary; +import gnu.trove.iterator.TIntObjectIterator; import gnu.trove.iterator.TLongIterator; import gnu.trove.list.array.TIntArrayList; import gnu.trove.list.array.TLongArrayList; @@ -34,6 +35,8 @@ import net.osmand.binary.BinaryMapIndexReader.TagValuePair; import net.osmand.binary.BinaryMapPoiReaderAdapter.PoiRegion; import net.osmand.binary.BinaryMapPoiReaderAdapter.PoiSubType; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteRegion; +import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteSubregion; +import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule; import net.osmand.binary.BinaryMapTransportReaderAdapter.TransportIndex; import net.osmand.data.Amenity; import net.osmand.data.AmenityType; @@ -58,11 +61,13 @@ public class BinaryInspector { if(args.length == 1 && "test".equals(args[0])) { in.inspector(new String[]{ //"-vpoi", - "-vmap", "-vmapobjects", +// "-vmap", "-vmapobjects", +// "-vrouting", // "-vaddress", "-vcities", "-vstreets", "-vstreetgroups","-vbuildings", //"-zoom=16", //"-bbox=4,55,7,50", "/home/victor/projects/osmand/osm-gen/Map.obf" +// "/home/victor/projects/osmand/osm-gen/Netherlands_europe.obf" // "/home/victor/projects/osmand/osm-gen/World_basemap_2_b.obf___" // "/home/victor/projects/osmand/osm-gen/World_basemap_2.obf__" }); @@ -106,6 +111,7 @@ public class BinaryInspector { boolean vtransport; boolean vpoi; boolean vmap; + boolean vrouting; boolean vmapObjects; boolean osm; FileOutputStream osmOut = null; @@ -126,6 +132,11 @@ public class BinaryInspector { public boolean isVmap() { return vmap; } + + public boolean isVrouting() { + return vrouting; + } + public boolean isVpoi() { return vpoi; } @@ -150,6 +161,8 @@ public class BinaryInspector { vintersections = true; } else if(params[i].equals("-vmap")){ vmap = true; + } else if(params[i].equals("-vrouting")){ + vrouting = true; } else if(params[i].equals("-vmapobjects")){ vmapObjects = true; } else if(params[i].equals("-vpoi")){ @@ -451,6 +464,9 @@ public class BinaryInspector { RouteRegion ri = ((RouteRegion) p); println("\tBounds " + formatLatBounds(ri.getLeftLongitude(), ri.getRightLongitude(), ri.getTopLatitude(), ri.getBottomLatitude())); + if((vInfo != null && vInfo.isVrouting())){ + printRouteDetailInfo(index, (RouteRegion) p); + } } else if(p instanceof MapIndex){ MapIndex m = ((MapIndex) p); int j = 1; @@ -486,6 +502,45 @@ public class BinaryInspector { } + private void printRouteDetailInfo(BinaryMapIndexReader index, RouteRegion p) throws IOException { + final DamnCounter mapObjectsCounter = new DamnCounter(); + final StringBuilder b = new StringBuilder(); + List regions = index.searchRouteIndexTree( + BinaryMapIndexReader.buildSearchRequest(MapUtils.get31TileNumberX(vInfo.lonleft), + MapUtils.get31TileNumberX(vInfo.lonright), MapUtils.get31TileNumberY(vInfo.lattop), + MapUtils.get31TileNumberY(vInfo.latbottom), vInfo.getZoom(), null), + p.getSubregions()); + index.loadRouteIndexData(regions, new ResultMatcher() { + @Override + public boolean publish(RouteDataObject obj) { + mapObjectsCounter.value++; + b.setLength(0); + b.append("Road "); + b.append(obj.id); + for(int i = 0; i < obj.getTypes().length; i++) { + RouteTypeRule rr = obj.region.quickGetEncodingRule(obj.getTypes()[i]); + b.append(" ").append(rr.getTag()).append("='").append(rr.getValue()).append("'"); + } + if (obj.getNames() != null) { + TIntObjectIterator it = obj.getNames().iterator(); + while (it.hasNext()) { + it.advance(); + RouteTypeRule rr = obj.region.quickGetEncodingRule(it.key()); + b.append(" ").append(rr.getTag()).append("='").append(it.value()).append("'"); + } + } + println(b.toString()); + return false; + } + + @Override + public boolean isCancelled() { + return false; + } + }); + println("\tTotal map objects: " + mapObjectsCounter.value); + } + private void printAddressDetailedInfo(VerboseInfo verbose, BinaryMapIndexReader index, AddressRegion region) throws IOException { String[] cityType_String = new String[] { "Cities/Towns section", @@ -832,7 +887,7 @@ public class BinaryInspector { } println("Inspector is console utility for working with binary indexes of OsmAnd."); println("It allows print info about file, extract parts and merge indexes."); - println("\nUsage for print info : inspector [-vaddress] [-vstreetgroups] [-vstreets] [-vbuildings] [-vintersections] [-vmap] [-vmapobjects] [-osm] [-vpoi] [-vtransport] [-zoom=Zoom] [-bbox=LeftLon,TopLat,RightLon,BottomLan] [file]"); + println("\nUsage for print info : inspector [-vaddress] [-vstreetgroups] [-vstreets] [-vbuildings] [-vintersections] [-vmap] [-vmapobjects] [-osm] [-vpoi] [-vrouting] [-vtransport] [-zoom=Zoom] [-bbox=LeftLon,TopLat,RightLon,BottomLan] [file]"); println(" Prints information about [file] binary index of OsmAnd."); println(" -v.. more verbouse output (like all cities and their streets or all map objects with tags/values and coordinates)"); println("\nUsage for combining indexes : inspector -c file_to_create (file_from_extract ((+|-)parts_to_extract)? )*"); diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java index 8c1dc64975..0625a5124b 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRulesStorage.java @@ -479,11 +479,12 @@ public class RenderingRulesStorage { // int count = 100000; // for (int i = 0; i < count; i++) { RenderingRuleSearchRequest searchRequest = new RenderingRuleSearchRequest(storage); - searchRequest.setStringFilter(storage.PROPS.R_TAG, "building"); - searchRequest.setStringFilter(storage.PROPS.R_VALUE, "yes"); - searchRequest.setIntFilter(storage.PROPS.R_LAYER, 1); - searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 16); - searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 16); + searchRequest.setStringFilter(storage.PROPS.R_TAG, "natural"); + searchRequest.setStringFilter(storage.PROPS.R_VALUE, "tree"); + searchRequest.setStringFilter(storage.PROPS.R_ADDITIONAL, "leaf_type=broadleaved"); +// searchRequest.setIntFilter(storage.PROPS.R_LAYER, 1); + searchRequest.setIntFilter(storage.PROPS.R_MINZOOM, 18); + searchRequest.setIntFilter(storage.PROPS.R_MAXZOOM, 18); // searchRequest.setBooleanFilter(storage.PROPS.R_NIGHT_MODE, true); // searchRequest.setBooleanFilter(storage.PROPS.get("hmRendered"), true); for (RenderingRuleProperty customProp : storage.PROPS.getCustomRules()) { @@ -493,7 +494,7 @@ public class RenderingRulesStorage { searchRequest.setStringFilter(customProp, ""); } } - boolean res = searchRequest.search(POLYGON_RULES); + boolean res = searchRequest.search(POINT_RULES); System.out.println("Result " + res); printResult(searchRequest, System.out); // } diff --git a/OsmAnd-java/src/net/osmand/render/RenderingRulesTransformer.java b/OsmAnd-java/src/net/osmand/render/RenderingRulesTransformer.java index d0c0f81da8..b41a741909 100644 --- a/OsmAnd-java/src/net/osmand/render/RenderingRulesTransformer.java +++ b/OsmAnd-java/src/net/osmand/render/RenderingRulesTransformer.java @@ -8,7 +8,6 @@ import java.util.Map; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; import javax.xml.parsers.ParserConfigurationException; -import javax.xml.transform.OutputKeys; import javax.xml.transform.Transformer; import javax.xml.transform.TransformerException; import javax.xml.transform.TransformerFactory; @@ -37,7 +36,7 @@ public class RenderingRulesTransformer { transform(document); TransformerFactory transformerFactory = TransformerFactory.newInstance(); Transformer transformer = transformerFactory.newTransformer(); - transformer.setOutputProperty(OutputKeys.INDENT, "yes"); +// transformer.setOutputProperty(OutputKeys.INDENT, "yes"); DOMSource source = new DOMSource(document.getDocumentElement()); StreamResult streamResult = new StreamResult(new File(targetFile)); transformer.transform(source, streamResult); @@ -47,18 +46,17 @@ public class RenderingRulesTransformer { static Map patterns = new HashMap(); public static void transform(Document document) { - collectPatterns(document); - applyPatterns(document); - - combineAllApplyTags(document); - - replaceTag(document, "ifelse", "filter"); - replaceTag(document, "check", "filter"); - replaceTag(document, "check_and_apply", "filter"); +// collectPatterns(document); +// applyPatterns(document); +// combineAllApplyTags(document); +// +// replaceTag(document, "ifelse", "filter"); +// replaceTag(document, "check", "filter"); +// replaceTag(document, "check_and_apply", "filter"); } - private static void combineAllApplyTags(Document document) { + public static void combineAllApplyTags(Document document) { NodeList nl = document.getElementsByTagName("apply"); while(nl.getLength() > 0) { Element app = (Element) nl.item(0); @@ -77,7 +75,7 @@ public class RenderingRulesTransformer { } - private static void applyPatterns(Document document) { + public static void applyPatterns(Document document) { NodeList nl = document.getElementsByTagName("apply"); for (int i = 0; i < nl.getLength();) { Element app = (Element) nl.item(i); @@ -100,7 +98,7 @@ public class RenderingRulesTransformer { } - private static void collectPatterns(Document document) { + public static void collectPatterns(Document document) { NodeList nl = document.getElementsByTagName("pattern"); while(nl.getLength() > 0) { Element pt = (Element) nl.item(0); @@ -112,7 +110,7 @@ public class RenderingRulesTransformer { } - protected static void replaceTag(Document document, final String tag, final String targetTag) { + public static void replaceTag(Document document, final String tag, final String targetTag) { NodeList nl = document.getElementsByTagName(tag); while(nl.getLength() > 0) { Element newElement = document.createElement(targetTag); diff --git a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java index 44512c4a0e..2a1fa3e03c 100644 --- a/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java +++ b/OsmAnd-java/src/net/osmand/router/BinaryRoutePlanner.java @@ -17,7 +17,7 @@ import org.apache.commons.logging.Log; public class BinaryRoutePlanner { - private static final int TEST_ID = 235108903; + private static final int TEST_ID = 31370645; private static final boolean TEST_SPECIFIC = false; private static final int REVERSE_WAY_RESTRICTION_ONLY = 1024; @@ -700,6 +700,14 @@ public class BinaryRoutePlanner { public void visitSegment(RouteSegment segment, int segmentEnd, boolean poll); } + public static class RouteSegmentPoint extends RouteSegment{ + public RouteSegmentPoint(RouteDataObject road, int segmentStart) { + super(road, segmentStart); + } + public int preciseX; + public int preciseY; + } + public static class RouteSegment { final short segStart; final RouteDataObject road; diff --git a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java index b1bb749950..6f5cc4ce94 100644 --- a/OsmAnd-java/src/net/osmand/router/GeneralRouter.java +++ b/OsmAnd-java/src/net/osmand/router/GeneralRouter.java @@ -324,7 +324,7 @@ public class GeneralRouter implements VehicleRouter { RouteTypeRule r = reg.quickGetEncodingRule(pt[i]); if ("highway".equals(r.getTag()) && "traffic_signals".equals(r.getValue())) { // traffic signals don't add turn info - return 0; +// return 0; } } } diff --git a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java index b2176a03b9..e61ad49676 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java +++ b/OsmAnd-java/src/net/osmand/router/RoutePlannerFrontEnd.java @@ -15,6 +15,7 @@ import net.osmand.binary.RouteDataObject; import net.osmand.data.LatLon; import net.osmand.data.QuadPoint; import net.osmand.router.BinaryRoutePlanner.RouteSegment; +import net.osmand.router.BinaryRoutePlanner.RouteSegmentPoint; import net.osmand.util.MapUtils; import org.apache.commons.logging.Log; @@ -50,7 +51,7 @@ public class RoutePlannerFrontEnd { return dx * dx + dy * dy; } - public RouteSegment findRouteSegment(double lat, double lon, RoutingContext ctx) throws IOException { + public RouteSegmentPoint findRouteSegment(double lat, double lon, RoutingContext ctx) throws IOException { int px = MapUtils.get31TileNumberX(lon); int py = MapUtils.get31TileNumberY(lat); ArrayList dataObjects = new ArrayList(); @@ -58,9 +59,9 @@ public class RoutePlannerFrontEnd { if (dataObjects.isEmpty()) { ctx.loadTileData(px, py, 15, dataObjects); } - RouteSegment road = null; + RouteSegmentPoint road = null; + double sdist = 0; - for (RouteDataObject r : dataObjects) { if (r.getPointsLength() > 1) { for (int j = 1; j < r.getPointsLength(); j++) { @@ -69,17 +70,18 @@ public class RoutePlannerFrontEnd { double currentsDist = squareDist((int) pr.x, (int)pr.y, px, py); if (road == null || currentsDist < sdist) { RouteDataObject ro = new RouteDataObject(r); - road = new RouteSegment(ro, j); - ro.insert(j, (int) pr.x, (int)pr.y); + road = new RouteSegmentPoint(ro, j); + road.preciseX = (int) pr.x; + road.preciseY = (int) pr.y; sdist = currentsDist; } } } } - if (road != null) { +// if (road != null) { // re-register the best road because one more point was inserted - ctx.registerRouteDataObject(road.getRoad()); - } +// ctx.registerRouteDataObject(road.getRoad()); +// } return road; } @@ -122,10 +124,11 @@ public class RoutePlannerFrontEnd { if(res != null) { new RouteResultPreparation().printResults(ctx, start, end, res); } + makeStartEndPointsPrecise(res, start, end, intermediates); return res; } int indexNotFound = 0; - List points = new ArrayList(); + List points = new ArrayList(); if(!addSegment(start, ctx, indexNotFound++, points)){ return null; } @@ -140,14 +143,123 @@ public class RoutePlannerFrontEnd { return null; } List res = searchRoute(ctx, points, routeDirection); + // make start and end more precise + makeStartEndPointsPrecise(res, start, end, intermediates); if(res != null) { new RouteResultPreparation().printResults(ctx, start, end, res); } return res; } + + protected void makeStartEndPointsPrecise(List res, LatLon start, LatLon end, List intermediates) { + if (res.size() > 0) { + updateResult(res.get(0), start, true); + updateResult(res.get(res.size() - 1), end, false); + if (intermediates != null) { + int k = 1; + for (int i = 0; i < intermediates.size(); i++) { + LatLon ll = intermediates.get(i); + int px = MapUtils.get31TileNumberX(ll.getLongitude()); + int py = MapUtils.get31TileNumberY(ll.getLatitude()); + for (; k < res.size(); k++) { + double currentsDist = projectDistance(res, k, px, py); + if (currentsDist < 500 * 500) { + for (int k1 = k + 1; k1 < res.size(); k1++) { + double c2 = projectDistance(res, k1, px, py); + if (c2 < currentsDist) { + k = k1; + currentsDist = c2; + } else if (k1 - k > 15) { + break; + } + } + updateResult(res.get(k), ll, false); + if (k < res.size() - 1) { + updateResult(res.get(k + 1), ll, true); + } + break; + } + } + } + } + } + } + + protected double projectDistance(List res, int k, int px, int py) { + RouteSegmentResult sr = res.get(k); + RouteDataObject r = sr.getObject(); + QuadPoint pp = MapUtils.getProjectionPoint31(px, py, + r.getPoint31XTile(sr.getStartPointIndex()), r.getPoint31YTile(sr.getStartPointIndex()), + r.getPoint31XTile(sr.getEndPointIndex()), r.getPoint31YTile(sr.getEndPointIndex())); + double currentsDist = squareDist((int) pp.x, (int)pp.y, px, py); + return currentsDist; + } - private boolean addSegment(LatLon s, RoutingContext ctx, int indexNotFound, List res) throws IOException { - RouteSegment f = findRouteSegment(s.getLatitude(), s.getLongitude(), ctx); + private void updateResult(RouteSegmentResult routeSegmentResult, LatLon point, boolean st) { + int px = MapUtils.get31TileNumberX(point.getLongitude()); + int py = MapUtils.get31TileNumberY(point.getLatitude()); + int pind = st ? routeSegmentResult.getStartPointIndex() : routeSegmentResult.getEndPointIndex(); + + RouteDataObject r = routeSegmentResult.getObject(); + QuadPoint before = null; + QuadPoint after = null; + if(pind > 0) { + before = MapUtils.getProjectionPoint31(px, py, r.getPoint31XTile(pind - 1), + r.getPoint31YTile(pind - 1), r.getPoint31XTile(pind ), r.getPoint31YTile(pind )); + } + if(pind < r.getPointsLength() - 1) { + after = MapUtils.getProjectionPoint31(px, py, r.getPoint31XTile(pind + 1), + r.getPoint31YTile(pind + 1), r.getPoint31XTile(pind ), r.getPoint31YTile(pind )); + } + int insert = 0; + double dd = MapUtils.getDistance(point, MapUtils.get31LatitudeY(r.getPoint31YTile(pind)), + MapUtils.get31LongitudeX(r.getPoint31XTile(pind))); + double ddBefore = Double.POSITIVE_INFINITY; + double ddAfter = Double.POSITIVE_INFINITY; + QuadPoint i = null; + if(before != null) { + ddBefore = MapUtils.getDistance(point, MapUtils.get31LatitudeY((int) before.y), + MapUtils.get31LongitudeX((int) before.x)); + if(ddBefore < dd) { + insert = -1; + i = before; + } + } + + if(after != null) { + ddAfter = MapUtils.getDistance(point, MapUtils.get31LatitudeY((int) after.y), + MapUtils.get31LongitudeX((int) after.x)); + if(ddAfter < dd && ddAfter < ddBefore) { + insert = 1; + i = after; + } + } + + if (insert != 0) { + if (st && routeSegmentResult.getStartPointIndex() < routeSegmentResult.getEndPointIndex()) { + routeSegmentResult.setEndPointIndex(routeSegmentResult.getEndPointIndex() + 1); + } + if (!st && routeSegmentResult.getStartPointIndex() > routeSegmentResult.getEndPointIndex()) { + routeSegmentResult.setStartPointIndex(routeSegmentResult.getStartPointIndex() + 1); + } + if (insert > 0) { + r.insert(pind + 1, (int) i.x, (int) i.y); + if (st) { + routeSegmentResult.setStartPointIndex(routeSegmentResult.getStartPointIndex() + 1); + } + if (!st) { + routeSegmentResult.setEndPointIndex(routeSegmentResult.getEndPointIndex() + 1); + } + } else { + r.insert(pind, (int) i.x, (int) i.y); + } + + } + + } + + private boolean addSegment(LatLon s, RoutingContext ctx, int indexNotFound, List res) throws IOException { + RouteSegmentPoint f = findRouteSegment(s.getLatitude(), s.getLongitude(), ctx); if(f == null){ ctx.calculationProgress.segmentNotFound = indexNotFound; return false; @@ -202,7 +314,7 @@ public class RoutePlannerFrontEnd { long time = System.currentTimeMillis(); RouteSegmentResult[] res = ctx.nativeLib.runNativeRouting(ctx.startX, ctx.startY, ctx.targetX, ctx.targetY, ctx.config, regions, ctx.calculationProgress, ctx.precalculatedRouteDirection, ctx.calculationMode == RouteCalculationMode.BASE); - System.out.println("Native routing took " + (System.currentTimeMillis() - time) / 1000f + " seconds"); + log.info("Native routing took " + (System.currentTimeMillis() - time) / 1000f + " seconds"); ArrayList result = new ArrayList(Arrays.asList(res)); ctx.routingTime = ctx.calculationProgress.routingCalculatedTime; ctx.visitedSegments = ctx.calculationProgress.visitedSegments; @@ -211,7 +323,7 @@ public class RoutePlannerFrontEnd { } - private List searchRoute(final RoutingContext ctx, List points, PrecalculatedRouteDirection routeDirection) + private List searchRoute(final RoutingContext ctx, List points, PrecalculatedRouteDirection routeDirection) throws IOException, InterruptedException { if (points.size() <= 2) { ctx.previouslyCalculatedRoute = null; diff --git a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java index 4b8249743f..1fa0b3afad 100644 --- a/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java +++ b/OsmAnd-java/src/net/osmand/router/RouteResultPreparation.java @@ -8,6 +8,9 @@ import java.util.Collections; import java.util.Iterator; import java.util.List; +import org.apache.commons.logging.Log; + +import net.osmand.PlatformUtil; import net.osmand.binary.BinaryMapIndexReader; import net.osmand.binary.BinaryMapRouteReaderAdapter.RouteTypeRule; import net.osmand.binary.RouteDataObject; @@ -21,6 +24,7 @@ public class RouteResultPreparation { public static boolean PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST = false; private static final float TURN_DEGREE_MIN = 45; + private Log log = PlatformUtil.getLog(RouteResultPreparation.class); /** * Helper method to prepare final result */ @@ -258,12 +262,14 @@ public class RouteResultPreparation { double startLon = start.getLongitude(); double endLat = end.getLatitude(); double endLon = end.getLongitude(); - println(MessageFormat.format("", startLat + "", startLon + "", endLat + "", endLon + "", ctx.config.routerName, "loadedTiles = \"" + ctx.loadedTiles + "\" " + "visitedSegments = \"" + ctx.visitedSegments + "\" " + "complete_distance = \"" + completeDistance + "\" " + "complete_time = \"" + completeTime + "\" " + - "routing_time = \"" + ctx.routingTime + "\" ")); + "routing_time = \"" + ctx.routingTime + "\" "); + log.info(msg); + println(msg); if (PRINT_TO_CONSOLE_ROUTE_INFORMATION_TO_TEST) { for (RouteSegmentResult res : result) { String name = res.getObject().getName(); diff --git a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java index a73bd6ea45..ccadfc0ebc 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java +++ b/OsmAnd-java/src/net/osmand/router/RoutingConfiguration.java @@ -87,6 +87,7 @@ public class RoutingConfiguration { i.memoryLimitation = memoryLimitMB * (1 << 20); } i.planRoadDirection = parseSilentInt(getAttribute(i.router, "planRoadDirection"), i.planRoadDirection); +// i.planRoadDirection = 1; return i; } diff --git a/OsmAnd-java/src/net/osmand/router/RoutingContext.java b/OsmAnd-java/src/net/osmand/router/RoutingContext.java index 7889ca7b34..ca2f4615fc 100644 --- a/OsmAnd-java/src/net/osmand/router/RoutingContext.java +++ b/OsmAnd-java/src/net/osmand/router/RoutingContext.java @@ -213,25 +213,6 @@ public class RoutingContext { startY = start.road.getPoint31YTile(start.getSegmentStart()); } - public void registerRouteDataObject(RouteDataObject o ) { - if(!getRouter().acceptLine(o)){ - return; - } - for(int k = 0; k routes = tileRoutes.get(tileId); - if(routes == null){ - routes = new ArrayList(); - tileRoutes.put(tileId, routes); - } - if(!routes.contains(o)){ - routes.add(o); - } - } - } - public void unloadAllData() { unloadAllData(null); } diff --git a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java index 2bb5216ba4..9f1c6d6b50 100644 --- a/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java +++ b/OsmAnd-java/src/net/osmand/util/GeoPointParserUtil.java @@ -45,6 +45,13 @@ public class GeoPointParserUtil { actual = GeoPointParserUtil.parse("geo", url); assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z, name)); + // geo:34.99,-106.61?q=34.99%2C-106.61 (Treasure Island) + z = GeoParsedPoint.NO_ZOOM; + url = "geo:" + dlat + "," + dlon + "?q=" + dlat + "%2C" + dlon + " (" + name + ")"; + System.out.println("url: " + url); + actual = GeoPointParserUtil.parse("geo", url); + assertGeoPoint(actual, new GeoParsedPoint(dlat, dlon, z, name)); + // 0,0?q=34,-106(Treasure Island) z = GeoParsedPoint.NO_ZOOM; url = "geo:0,0?q=" + ilat + "," + ilon + " (" + name + ")"; @@ -331,7 +338,7 @@ public class GeoPointParserUtil { * @return {@link GeoParsedPoint} */ public static GeoParsedPoint parse(final String scheme, final String uri) { - final URI data = URI.create(uri.replaceAll("\\s+", "+").replaceAll("%20", "+")); + final URI data = URI.create(uri.replaceAll("\\s+", "+").replaceAll("%20", "+").replaceAll("%2C", ",")); if ("http".equals(scheme) || "https".equals(scheme)) { final String schemeSpecific = data.getSchemeSpecificPart(); @@ -469,7 +476,7 @@ public class GeoPointParserUtil { } else { // geo:47.6,-122.3 // geo:47.6,-122.3?z=11 (Treasure Island) - final String pattern = "([+-]?\\d+(?:\\.\\d+)?),([+-]?\\d+(?:\\.\\d+)?)(?:\\?z=(\\d{1,2}))?[\\+]?(?:\\((.*?)\\))?"; + final String pattern = "([+-]?\\d+(?:\\.\\d+)?),([+-]?\\d+(?:\\.\\d+)?)(?:(?:\\?z=(\\d{1,2}))?|(?:\\?q=.*?)?)[\\+]?(?:\\((.*?)\\))?"; final Matcher matcher = Pattern.compile(pattern).matcher(schemeSpecific); if (matcher.matches()) { final double lat = Double.valueOf(matcher.group(1)); diff --git a/OsmAnd-java/src/net/osmand/util/MapUtils.java b/OsmAnd-java/src/net/osmand/util/MapUtils.java index 26539d57d1..917799f906 100644 --- a/OsmAnd-java/src/net/osmand/util/MapUtils.java +++ b/OsmAnd-java/src/net/osmand/util/MapUtils.java @@ -248,18 +248,18 @@ public class MapUtils { return (rotateSin * dTileX + rotateCos * dTileY) * tileSize ; } - public static double getLatitudeFromTile(float zoom, double y){ + public static double getLatitudeFromTile(float zoom, double y) { int sign = y < 0 ? -1 : 1; - return Math.atan(sign*Math.sinh(Math.PI * (1 - 2 * y / getPowZoom(zoom)))) * 180d / Math.PI; + return Math.atan(sign * Math.sinh(Math.PI * (1 - 2 * y / getPowZoom(zoom)))) * 180d / Math.PI; } - public static int getPixelShiftX(int zoom, double long1, double long2, int tileSize){ + public static int getPixelShiftX(float zoom, double long1, double long2, double tileSize){ return (int) ((getTileNumberX(zoom, long1) - getTileNumberX(zoom, long2)) * tileSize); } - public static int getPixelShiftY(int zoom, double lat1, double lat2, int tileSize){ + public static int getPixelShiftY(float zoom, double lat1, double lat2, double tileSize){ return (int) ((getTileNumberY(zoom, lat1) - getTileNumberY(zoom, lat2)) * tileSize); } diff --git a/OsmAnd/assets/bundled_assets.xml b/OsmAnd/assets/bundled_assets.xml index a6d46d9d50..f3240fa183 100755 --- a/OsmAnd/assets/bundled_assets.xml +++ b/OsmAnd/assets/bundled_assets.xml @@ -25,6 +25,7 @@ + diff --git a/OsmAnd/libs/android-support-v4.jar b/OsmAnd/libs/android-support-v4.jar index 187bdf48b1..c31cede47e 100644 Binary files a/OsmAnd/libs/android-support-v4.jar and b/OsmAnd/libs/android-support-v4.jar differ diff --git a/OsmAnd/res/values-ca/strings.xml b/OsmAnd/res/values-ca/strings.xml index eae18e2dff..20f11f7036 100644 --- a/OsmAnd/res/values-ca/strings.xml +++ b/OsmAnd/res/values-ca/strings.xml @@ -1895,4 +1895,6 @@ La llista de països inclosos (bàsicament tot el món!): Afganistan, Albània, Càmera de control de velocitat Avís de circulació Premeu qualsevol indicació existent per veure més detalls, mantingueu premuda per desactivar o esborrar. Dades actuals al dispositiu (%1$s lliure): - + Definiu la mida del text en el mapa. + Mida del text + diff --git a/OsmAnd/res/values-cs/strings.xml b/OsmAnd/res/values-cs/strings.xml index f83febc95e..4f83de4e8f 100644 --- a/OsmAnd/res/values-cs/strings.xml +++ b/OsmAnd/res/values-cs/strings.xml @@ -1734,4 +1734,5 @@ s často kladenými otázkami. Dopravní varování Klikněte na existující položku k zobrazení více detailů, podržte pro vypnutí nebo smazání. V zařízení je %1$s volného místa: - + Velikost písma + diff --git a/OsmAnd/res/values-da/strings.xml b/OsmAnd/res/values-da/strings.xml index 1e0c22459f..0ef6c1def7 100644 --- a/OsmAnd/res/values-da/strings.xml +++ b/OsmAnd/res/values-da/strings.xml @@ -1124,7 +1124,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, Brug trackball for at flytte kortet Brug trackball Indstil maksimal ventetid mellem hver positionssøgning i baggrunden - Maksimal ventetid på låsning + Maks ventetid på låsning Sluk for OsmAnd navigationstjeneste i dvaletilstand Hvor er jeg? Netværk @@ -1270,7 +1270,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, Online søgning ved hjælp af OSM Nominatim Husnummer, gade, by Online søgning - Maks. online zoom + Maks online zoom Vælg maksimum zoomniveau der hentes for online delkort Kortkilden og lag der vises kan ændres via \'Menu\' → \'Kortlag\'. \n\nUnder \'Kortkilde...\' vælges de forhåndsindlæste vektorkort, forhåndsdefinerede (online) delkortkilder (aktiver \'Online og delkort\' udvidelsen) eller kort der er manuelt oprettet f.eks. ved hjælp af OsmAndMapCreator på en PC. @@ -1557,8 +1557,8 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, Område Vælg område: USA, Europa, England, Asien m.fl. FPS-fejlsøgningssinfo - Udløber ( minutter): %1$s - Maksimal zoomniveau: %1$s + Udløber (minutter): %1$s + Maks zoomniveau: %1$s Minimum zoomniveau: %1$s Elliptisk mercator Maks. zoomniveau @@ -1658,7 +1658,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, Undgå færger Motorveje Undgå motorveje - Maksimal vægt + Maks vægt Angiv køretøjets vægt begrænsning Korteste rute Anvend korteste rute @@ -1846,7 +1846,7 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, GPX-spor er tomt Rutepunkter: %1$s Afstand: %1$s (%2$s punkter) - Startid: %1$tF, %1$tT + "Starttid: %1$tF, %1$tT " Sluttid: %1$tF, %1$tT Gennemsnitshastighed: %1$s Maks hastighed: %1$s @@ -1987,4 +1987,6 @@ Afghanistan, Albanien, Algeriet, Andorra, Angola, Anguilla, Antigua og Barbuda, Fartkamera Trafikadvarsel Klik på et eksisterende element for at se flere detaljer, langt tryk for at deaktivere eller slette. Aktuelle data på enhed (%1$s ledig): - + Vælg tekststørrelsen på kortet. + Tekststørrelse + diff --git a/OsmAnd/res/values-de/strings.xml b/OsmAnd/res/values-de/strings.xml index 44999d3a6e..2031160cb2 100644 --- a/OsmAnd/res/values-de/strings.xml +++ b/OsmAnd/res/values-de/strings.xml @@ -1839,11 +1839,7 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Geräte-ID Konfigurieren der Überwachungs-Einstellungen und des persönlichen Überwachungs-Kanals - OpenStreetMap erweiterte Live-Überwachung, siehe http://osmo.mobi. Ermöglicht die Verfolgung des eigenen oder anderer Geräten. - Erstellen anonymer Gruppen, teilen des Standortes sowie Kommunizieren untereinander. Es gibt verschiedene Einstellungen für Sitzungs- oder Permanenet-Aufzeichnung. - Anonyme Gruppen sind-zeit-oder funktionslimitiert, ohne Fernkonfiguration oder Gruppen-Adminisrator - Voll funktionsfähige Gruppen müssen auf der Internetseite erstellt werden, auf diese haben nur registrierte Nutzer Zugriff. - + "Erweiterte OpenStreetMap-basierte Live-Überwachung, siehe http://osmo.mobi ... Ermöglicht die Positionsdarstellung in von einzelnen Geräten in Echtzeit. Bei anonym erstellten Gruppen sind die Optionen etwas eingeschränkt: Lebensdauer der Gruppe nur für einige Tage, auch ist keine zentrale Steuerung der Gruppe möglich. Es gibt verschiedene Einstellungen für zeitlich begrenzte oder Dauer-Aufzeichnung. Voll funktionsfähige Gruppen müssen auf der genannten Internetseite erstellt werden, auf die Gruppe haben nur registrierte Nutzer Zugriff. " OsMo (Erweiterte Live-Überwachung) OsMo OpenStreetMap-Überwachung OsMo Verbindungsproblem: @@ -1976,4 +1972,6 @@ Afghanistan, Ägypten, Albanien, Algerien, Andorra, Angola, Anguilla, Antigua an Speichern Sie Ihre Tracks mit einem Klick. Zeigt die Einstellung, wie Strecken aufgezeichnet werden – in lokale GPX-Dateien oder online via Web-Service. Antippen eines Elements um mehr Details zu erfahren, Tippen und Halten zum Deaktivieren oder Löschen des Elements. Aktuell auf dem Gerät vorhandene Daten (%1$s frei): - + Karten-Schriftgröße festlegen + Schriftgröße + diff --git a/OsmAnd/res/values-es/strings.xml b/OsmAnd/res/values-es/strings.xml index bc09305c62..957bdcbe13 100644 --- a/OsmAnd/res/values-es/strings.xml +++ b/OsmAnd/res/values-es/strings.xml @@ -1877,4 +1877,6 @@ Afganistán, Albania, Alemania, Andorra, Angola, Anguila, Antigua y Barbuda, Ant Pulsa cualquier objeto para ver más detalles, mantén pulsado para desactivar o borrar. Datos en el dispositivo actualmente (%1$s libre): Reductores de velocidad Alerta de tráfico - + Selecciona el tamaño del texto en el mapa. + Tamaño de texto + diff --git a/OsmAnd/res/values-it/strings.xml b/OsmAnd/res/values-it/strings.xml index 1598f1bdbd..15f7113b9d 100644 --- a/OsmAnd/res/values-it/strings.xml +++ b/OsmAnd/res/values-it/strings.xml @@ -1988,5 +1988,7 @@ Si consiglia di aggiungere uno o più punti intermedi per migliorarne le prestaz Moderazione del traffico Autovelox Avviso di traffico - Clicca su un oggetto per visualizzare maggiori dettagli, tieni premuto per disattivarlo o cancellarlo. Dati attualmente nel dispositivo (%1$s free): - + Clicca su un oggetto per visualizzare maggiori dettagli, tieni premuto per disattivarlo o cancellarlo. Dati attualmente nel dispositivo (%1$s liberi): + Imposta la dimensione del testo sulla mappa. + Dimensione del testo + diff --git a/OsmAnd/res/values-ko/strings.xml b/OsmAnd/res/values-ko/strings.xml index 7891b577b0..99e63c5367 100644 --- a/OsmAnd/res/values-ko/strings.xml +++ b/OsmAnd/res/values-ko/strings.xml @@ -2100,4 +2100,6 @@ Vanuatu, Venezuela, Vietnam, Wallis and Futuna, Western Sahara, Yemen, Zambia, Z 속도 경고 카메라 트래픽 경고 기존 항목을 클릭하여 더 많은 정보를 보세요. 비활성화 하려면 꾹 눌러주시거나 삭제하세요. 현재 데이터는 (%1$ s 무료): - + 지도에 텍스트 크기를 설정 합니다. + 텍스트 크기 + diff --git a/OsmAnd/res/values-lt/strings.xml b/OsmAnd/res/values-lt/strings.xml index 45dba2d09a..2efa9ac384 100644 --- a/OsmAnd/res/values-lt/strings.xml +++ b/OsmAnd/res/values-lt/strings.xml @@ -1838,4 +1838,6 @@ OsmAnd yra aktyviai tobulinama ir mūsų projektas bei jo tolesnis progresas pri Eismo greičio ribojimas Greičio matavimo kamera Eismo perspėjimas - + Nustatyti teksto žemėlapyje dydį + Teksto dydis + diff --git a/OsmAnd/res/values-nl/strings.xml b/OsmAnd/res/values-nl/strings.xml index 8888b56f3a..865d0cc594 100644 --- a/OsmAnd/res/values-nl/strings.xml +++ b/OsmAnd/res/values-nl/strings.xml @@ -164,7 +164,7 @@ Opties voor navigatie Algemene instellingen Kaartbeheer - Download en beheer kaarten, stemmen en GPX-tracks + Download en beheer kaarten en stemmen Algemene instellingen Kaartweergave en algemene instellingen Algemene app instellingen @@ -881,7 +881,7 @@ Toon opties voor ontwikkeling en foutopsporing, zoals navigatie met simulatie of het meten van de kaartweergavesnelheid. Plugin-manager Klik op een plugin om deze te (de)activeren. (Het kan nodig zijn om OsmAnd te herstarten.) - Plugins geven geavanceerde instellingen en extra functies + Schakel plugins in voor speciale functies en extra instellingen Plugin-manager Wijzigingen in 0.8.0: \n\t- *Plugin-functionaliteit* @@ -1970,4 +1970,6 @@ Afghanistan, Albanie, Algerije, Andorra, Angola, Anguilla, Antigua en Barbuda, A Snelheidscontrole Filemelding Tik om details te bekijken; houd ingedrukt om uit te schakelen of te verwijderen. Huidige gegevens op het toestel (%1$s beschikbaar): - + De grootte van tekst op de kaart instellen. + Tekstgrootte + diff --git a/OsmAnd/res/values-pl/strings.xml b/OsmAnd/res/values-pl/strings.xml index 850c60b0b8..4f74e18039 100644 --- a/OsmAnd/res/values-pl/strings.xml +++ b/OsmAnd/res/values-pl/strings.xml @@ -1947,4 +1947,6 @@ Afganistan, Afryka Południowa, Albania, Algieria, Andora, Angola, Anguilla, Ant Fotoradar Ostrzeżenia drogowe Kliknij istniejący element, aby zobaczyć szczegóły, naciśnij i przytrzymaj, aby wyłączyć lub usunąć. Aktualne dane na urządzeniu (%1$s wolne): - + Ustaw rozmiar tekstu na mapie. + Rozmiar tekstu + diff --git a/OsmAnd/res/values-pt/strings.xml b/OsmAnd/res/values-pt/strings.xml index 8f420d5dab..30dab50e44 100644 --- a/OsmAnd/res/values-pt/strings.xml +++ b/OsmAnd/res/values-pt/strings.xml @@ -1,4 +1,5 @@ -Administrativo + +Administrativo Barreira Educação Emergência @@ -1796,4 +1797,31 @@ Afeganistão , Albânia, Argélia , Andorra, Angola , Anguilla, Antígua e Barbu Visível Mostrar botões de zoom durante a navegação Mostrar botões de zoom - \ No newline at end of file + Defina o tamanho do texto no mapa. + Tamanho do texto + Limite de Velocidade + Controle de fronteira + Portagem + Sinal de stop + Acalmia de tráfego + Câmara de velocidade + Aviso de tráfego + Anunciar nas proximidades favoritos + Anunciar nas proximidades de POI + Avisos de tráfego + Interromper o modo de hibernação do GPS? + Interrupção + Sempre perguntar + Escolher o intervalo de log para a gravação de faixa geral (habilitado através do widget de gravação GPX no mapa) + Intervalo de log geral + Ativar o modo de GPS em segundo plano + Salvar trilhas em GPX + Posição geral de log para um arquivo GPX pode ser ativada ou desativado usando o GPX gravação widget na tela do mapa + Intervalo de log + Modo de transporte público + Salve suas trilhas através do toque de um botão na tela do mapa. Mostre as configurações para gravar suas viagens para arquivos GPX locais ou on-line usando um serviço da web. + Gravar suas viagens + h + Duração + Distância + diff --git a/OsmAnd/res/values-sc/strings.xml b/OsmAnd/res/values-sc/strings.xml index 8188a23a19..1443a1dc61 100644 --- a/OsmAnd/res/values-sc/strings.xml +++ b/OsmAnd/res/values-sc/strings.xml @@ -1740,4 +1740,6 @@ Si cussigiat de annànghere unu o prus puntos intermedios pro megiorare sas pres Autovelox Avisu de tràficu Ischerta unu elementu esistente pro bìere prus detallios, carca e mantène carcau pro lu deativare o burrare. Datos como in su dispositivu (%1$s lìberos): - + Issèbera sa mannària de su testu in sa mapa. + Mannària de su testu + diff --git a/OsmAnd/res/values-sk/strings.xml b/OsmAnd/res/values-sk/strings.xml index 50cd07c6d0..a6fc9c1b79 100644 --- a/OsmAnd/res/values-sk/strings.xml +++ b/OsmAnd/res/values-sk/strings.xml @@ -1992,4 +1992,6 @@ Afganistan, Albánsko, Alžírsko, Andora, Angola, Anguilla, Antigua a Barbuda, Rýchlostný radar/kamera Dopravné varovanie Kliknite na existujúcu položku pre zobrazenie detailov. Podržte pre vypnutie alebo odstránenie. Dát je v súčasnosti na zariadení (%1$s voľné): - + Nastaviť veľkosť textu na mape. + Veľkosť textu + diff --git a/OsmAnd/res/values-sl/strings.xml b/OsmAnd/res/values-sl/strings.xml index 9721f26c55..be27f124b7 100644 --- a/OsmAnd/res/values-sl/strings.xml +++ b/OsmAnd/res/values-sl/strings.xml @@ -569,7 +569,7 @@ Zgradbe Mesto: %1$s\n%2$s "OsmAnd je navigacijska aplikacija s številnimi funkcijami. -\n\nNekaj osnovnih uvodov, uporabne nasvete in napredno pomoč dobite v povezavi z \'Meni\' → \'Pomoč\' na zaslonu zemljevida. " +\n\nOsnovni uvod, nekaj uporabnih namigov in trikov je na voljo na povezavi z \'Meni\' → \'Pomoč\' na zaslonu zemljevida. " Naprej Nazaj Pomoč @@ -594,7 +594,7 @@ Prenašanje … Odpakiranje novih podatkov … - "Da bi dobili navodila za kraj, bodisi neposredno dolgo kliknite nanj na zemljevidu (potem kliknite opis in izberite \'Navodila za\'), ali pa izberite \'Navigacija\' za vsak vnos v seznamu rezultatov iskanja ali seznama priljubljenih. + "Da bi dobili navodila za kraj, bodisi neposredno dolgo kliknite nanj na zemljevidu (potem kliknite opis in izberite \'Navodila za\'), ali pa izberite \'Navodila za\' za vsak vnos v seznamu rezultatov iskanja ali seznama priljubljenih. \n\nCilj je na zemljevidu označen s ciljno zastavico in OsmAnd prikazuje razdaljo in smer do njega (oranžni trikotnik). \n\nLahko izberete \'Začni navigacijo\', kar pomeni, da vas OsmAnd vodi, vam da glasovne ukaze (če so ti vklopljeni), itd. Ali pa lahko izberete \'Prikaži pot\', ki vam samo prikaže pot brez vodenja in popravljanja medtem ko se premikate. \n\nČe želite pokazati pot do cilja iz katerekoli druge točke, ki ni vaš trenutni položaj, izberite jo na zemljevidu in pritisnite \'Navodila od\'. @@ -667,15 +667,14 @@ \n\nTa je na voljo z dolgim pritiskom na katerokoli točko na zemljevidu (nato pritisnite na oznako) ali s pritiskom na gumb kroglico, ali z izbiro \'Meni\' → \'Uporabi lokacijo\' (zadnja dva načina uporabijo center zemljevida kot referenčno točko). \n\nOznako lahko spet skrijete če dolgo kliknete nanjo. - Mesta lahko iščete neposredno na zemljevidu preko \'Uporabi lokacijo\' → \'Iskanje v bližini\', ali s priklicem okna za iskanje preko \'Meni\' → \'Iskanje\'. - \n\nOkno za iskanje ima predloge za iskanje - \n\t* po naslovu - \n\t* preko koordinat - \n\t* kot POI (po vrsti ali po imenu) - \n\t* preko zgodovine iskanja - \n\t* ali prek vaših prednastavljenih priljubljenih. - \n\nKontekstni meni ali akcijska vrstica na vseh zadetkih ponujata možnosti, kot so \'Navigacija\' ali \'Prikaži na zemljevidu\', itd. - + "Mesta lahko iščete neposredno na zemljevidu preko \'Uporabi lokacijo\' → \'Iskanje v bližini\', ali s priklicem okna za iskanje preko \'Meni\' → \'Iskanje\'. +\n\nOkno za iskanje ima predloge za iskanje +\n\t* po naslovu +\n\t* preko koordinat +\n\t* kot POI (po vrsti ali po imenu) +\n\t* preko zgodovine iskanja +\n\t* ali prek vaših prednastavljenih priljubljenih. +\n\nKontekstni meni ali akcijska vrstica na vseh zadetkih ponujata možnosti, kot so \'Navodila za\' ali \'Prikaži na zemljevidu\', itd. " Dol %1$.3f šir %2$.3f @@ -1906,8 +1905,8 @@ Seznam držav (praktično ves svet!): Afganistan, Albanija, Alžirija, Andora, A Kolo Pešec Vse - Ovire - Najavi priljubljene + Prometna opozorila + Najavi bližnje priljubljene ur Trajanje Razdalja @@ -1921,7 +1920,7 @@ Seznam držav (praktično ves svet!): Afganistan, Albanija, Alžirija, Andora, A Registracija vaših potovanj Izleti Točke - Napovej POI + Najavi bližnji POI Brskaj zemljevid Prikaz stez po SAC lestvici Zaustavi navigacijo @@ -1930,4 +1929,14 @@ Seznam držav (praktično ves svet!): Afganistan, Albanija, Alžirija, Andora, A Shranite vaše sledi s pritiskom na gumb na oknu z zemljevidom. Pokaži nastavitve za snemanje vaših potovanj v krajevne datoteke GPX ali v oblak z uporabo spletnih storitev. Prikaz stez po OSMC sledeh - + Omejitev hitrosti + Mejni prehod + Cestninska postaja + Znak STOP + Prometno opozorilo + Hitrostna kamera + Ležeči policaj + Kliknite katerikoli obstoječi element za ogled podrobnosti, pritisnite in držite za izklop ali izbris. Trenutni podatki na napravi (%1$s prosto): + Nastavite velikost napisov na zemljevidu. + Velikost napisov + diff --git a/OsmAnd/res/values-sv/strings.xml b/OsmAnd/res/values-sv/strings.xml index a35ac4909d..3cae79d3be 100644 --- a/OsmAnd/res/values-sv/strings.xml +++ b/OsmAnd/res/values-sv/strings.xml @@ -18,11 +18,11 @@ Höjd Nästa sväng Visa larm … -Konfigurerar trafikvarningar (hastighetsgränser, stopp, vägbulor), varning för hastighetskameror samt körfältsinformation +Konfigurera trafikvarningar (hastighetsbegränsningar, stopp, vägbulor), varning för fartkameror samt körfältsinformation Använd kompassen när ingen riktning upptäcks på annat sätt Använd kompass Undvik motorvägar -Auto-zooma på kartan beroende på din hastighet (när kartan är synkroniserad med aktuell position) +Zooma in/ut automatiskt på kartan beroende på din hastighet (när kartan är synkroniserad med aktuell position) Automatisk kartzoomning "Förändringar i 0.8.3:\n\t* Waypoints\n\t* Förbättrad vägvisning\n\t* Inställning för att undvika motorvägar när man bygger en rutt\n\t* Lagt till ytterligare en typ av väg för cyklar till kartan (Cycleway=track)\n\t* Buggfixar " Fäst positionen på vägen under navigering @@ -727,7 +727,7 @@ Skicka rapport Hittar inga offline-data för regioner på SD-kortet. Ladda ner regioner från Internet. Ange sökfråga för att hitta POI - Någon + Alla Transportled Tack till Yandex för trafikinformationen. Yandex trafik @@ -1696,4 +1696,6 @@ Fartkamera Trafikdämpning Peta på en post för att se fler detaljer, tryck och håll för att inaktivera eller ta bort. Data på enheten (%1$s ledigt): - + Ange textstorlek på kartan. + Textstorlek + diff --git a/OsmAnd/res/values-zh-rTW/strings.xml b/OsmAnd/res/values-zh-rTW/strings.xml index d94f51bc0b..f69db7cfa7 100644 --- a/OsmAnd/res/values-zh-rTW/strings.xml +++ b/OsmAnd/res/values-zh-rTW/strings.xml @@ -42,7 +42,7 @@ 旅遊點 加油站 顯示警示… - 組態交通警示(速限、強制停車、減速)、測速照相警示、車道資訊 + 組態交通警示(速限、強制停車、減速丘)、測速照相警示、車道資訊 使用電子羅盤的地圖,正北朝上 使用電子羅盤 避開高速公路 @@ -76,23 +76,7 @@ OsmAnd 正在積極開發我們的專案,並且它的更進一步發展依賴於提供資金的捐助,用以資助發展和新功能的駕駛測試。請考慮購買 OsmAnd +,或資助特定的新功能或在 osmand.net 網站上一般捐贈。 將離線與線上的 OSM 地圖,用在全球行動地圖檢視和導航 - - OsmAnd+ OsmAnd (OSM Automated Navigation Directions) - OsmAnd 是開放源碼導航應用程式,可以使用各式各樣的全球性 OpenStreetMap (簡稱 OSM 開放街道地圖) 資料。所有圖資(向量圖或地圖圖磚)可存放於裝置的記憶卡上,可作離線與線上圖資導航,包含轉向建議(turn by turn)語音導航。 - -主要功能: - - 完整離線功能 (存放下載的向量圖或地圖圖磚) - - 全球離線向量圖資 - - 直接由手機下載各國或區域圖資 - - 可疊加不同的多種地圖層於自訂的透明度,如 GPX 或導航軌跡、興趣點、我的最愛、等高線、公共運輸站 - - 離線查尋地址、場所(POI) - - 離線尋找導航路線 - - 汽車、自行車、步行模式有下列選項: - - 可選擇自動日/夜模式切換 - - 可選擇取決於速度的地圖縮放 - - 可選擇地圖正北朝上或或行進方向朝上 - - 可選擇車道引導、速限顯示、使用真人語音或 TTS 語音 - + " OsmAnd+ OsmAnd (OSM Automated Navigation Directions) OsmAnd 是開放源碼導航應用程式,可以使用各式各樣的全球性 OpenStreetMap (簡稱 OSM 開放街道地圖) 資料。所有圖資(向量圖或地圖圖磚)可存放於裝置的記憶卡上,可作離線與線上圖資導航,包含轉向建議(turn by turn)語音導航。 主要功能: - 完整離線功能 (存放下載的向量圖或地圖圖磚) - 全球離線向量圖資 - 直接由手機下載各國或區域圖資 - 可疊加不同的多種地圖層於自訂的透明度,如 GPX 或導航軌跡、興趣點、我的最愛、等高線、大眾運輸停靠站 - 離線查尋地址、場所(POI) - 離線尋找導航路線 - 汽車、自行車、步行模式有下列選項: - 自動日/夜模式切換選項 - 取決於速度的地圖縮放選項 - 地圖正北朝上或行進方向朝上選項 - 車道引導、速限顯示、使用真人語音或 TTS 語音選項 " 更新離線地圖 "離線地圖的查看與 POI/位址查尋,以及離線導航,有最新的圖資是不可或缺的。OsmAnd 提供了地圖檔案的管理用以下載那些離線圖資,並且檢查能用的更新。 \n\n下載圖資更新由\'設定\' -> \'管理地圖檔案\' -> \'下載\'。 @@ -166,7 +150,7 @@ 您的愛車停在: 選擇模擬路線速度 已配置記憶體 %1$s MB (Android 限制%2$s MB, Dalvik %3$s MB)。 - 已配置記憶 + 已配置記憶體 原生記憶體總計 重新載入列表 起始標點離最近的道路太遠。 @@ -224,9 +208,9 @@ 起始標點尚未決定 未知地理位置 調整透明度(0 - 透明, 255 - 不透明) - 您要中斷檔案下載嗎? - 感謝您使用 OsmAnd。對於此應用程式的許多功能,您需要一些區域性的離線資料,您可以透過\'設定\' -> \'管理地圖檔案\'下載。之後您可瀏覽地圖、位置地址、查尋興趣點以及尋找共公交通設施。 - 基本地圖,為某些特別的應用功能必需使用的,並且預設為下載。 + 您要中斷下載中的檔案嗎? + 感謝您使用 OsmAnd。對於此應用程式的許多功能,您需要一些地區的離線資料,您可以透過\'設定\' -> \'管理地圖檔案\'來下載。之後您可瀏覽地圖、位置的地址、查看興趣點以及找到大眾運輸設施。 + 底圖為某些特別的應用功能必需使用的,並且預設為下載。 找不到任何資料。如果您不能在您的區域找到,您可以自行製作(參考http://osmand.net)。 線上地圖圖磚 離線地圖(向量地圖) @@ -234,7 +218,7 @@ 在您的裝置下載與管理離線地圖和檔案的存儲 啟用線上地圖外掛元件,來選擇不同的地圖來源 線上地圖圖磚 - 使用線上地圖(下載暫存地圖圖磚到SD卡) + 使用線上地圖(下載暫存地圖圖磚到 SD 卡) 線上地圖 組態線上或暫存的地圖圖磚來源 地圖設定 @@ -256,8 +240,8 @@ OsmAnd 開發 原生繪製 測試語音提示 - 該地區目前沒有離線向量地圖,您可在設定功能下載(管理地圖檔案)或切換成線上地圖(為此啟用線上地圖外掛)。 - 傳送 GPX 檔案到 OSM? + 該地區目前沒有離線向量地圖,您可在設定功能下載(管理地圖檔案)或切換成線上地圖(啟用線上地圖外掛元件)。 + 傳送 GPX 檔案到 OSM 嗎? 能見度 旗標 敘述 @@ -347,7 +331,7 @@ 線上即時追蹤網路地址 請啟用\'記錄軌跡成 GPX 檔案\'設定。 顯示目前軌跡 - 此 OsmAnd 免費版,只能下載 %1$s 個檔,且不支援離線維基百科的文章資料。 + 此 OsmAnd 免費版,有下載 %1$s 次限制,且不支援離線維基百科的文章資料。 免費版 顯示興趣點敘述 北美洲 @@ -385,12 +369,11 @@ 休眠模式 螢幕關閉時執行 OsmAnd 地圖方向 - 在地圖畫面上您可點選羅盤的圖示,可循環切換地圖旋轉顯示方式。 - \n\n選項有: - \n\t* \'不旋轉(正北朝上)\':地圖不旋轉,正北方永遠向上 - \n\t* \'行進方向\':地圖會不斷對準您的車頭方向 - \n\t* \'依羅盤\':地圖會不斷對準裝置的電子羅盤指示 - + "在地圖畫面上您可點選羅盤的圖示,可循環切換地圖旋轉顯示方式。 +\n\n選項有: +\n\t* \'不旋轉(正北朝上)\':地圖不旋轉,正北方永遠向上 +\n\t* \'行進方向朝上\':地圖會不斷對準您的車頭方向 +\n\t* \'依羅盤\':地圖會不斷對準裝置的電子羅盤指示 " 下載完成。 \n\t\n\t透過 \'選單\' -> \'地圖圖層\' -> \'地圖來源…\' -> \'離線向量地圖\'啟動使用。 @@ -508,7 +491,7 @@ 興趣點資料 TTS 語音 新的查尋 - 選擇地圖上的文字大小 + 選擇地圖上名稱的文字大小 地圖字型大小 繪製除錯資訊 顯示繪製效能 @@ -659,14 +642,14 @@ 有前一版的 OsmAnd 存在,所有的離線資料將被新版引用。但我的最愛內的標點須以舊版程式匯出後再用新版程式匯入。 編譯 {0} 成功安裝({1})。 - 下載編譯… + 正在下載編譯… 您要安裝 OsmAnd - {0} 由{1} {2} MB ? 檢索 OsmAnd 編譯列表失敗 - 載入 OsmAnd 編譯… + 正在載入 OsmAnd 編譯… 選擇 OsmAnd 編譯安裝 安裝的版本 GPS 狀態工具未安裝,到 Play 商場找嗎? - 語音導航無法使用。請到設定功能,選取喜歡的語音資料並且下載它。 + 語音導航無法使用。請到設定功能,選取喜歡的語音資料然後下載。 未選定語音導航 日間 夜間 @@ -676,7 +659,7 @@ 日/夜間模式 下載{0}個檔({1} MB)? 已選{0}項 - 篩選已下載的 + 已下載的 取消全選 全部選取 重整 @@ -721,7 +704,7 @@ 修改興趣點 刪除興趣點 依羅盤旋轉 - 行進方向 + 行進方向朝上 不旋轉(正北朝上) 選擇地圖畫面對準方式 地圖方位 @@ -732,14 +715,14 @@ 沒有我的最愛標點要儲存 匯入 匯出 - 載入 GPX 時發生錯誤 + 在載入 GPX 時發生錯誤 傳送報告 - SD卡上沒有離線資料。由網路下載資料。 + 在 SD 卡上沒有該地區離線資料。由網路下載資料。 輸入查尋條件以查尋興趣點 任何 交通路線 - 感謝Yandex提供交通資訊。 - Yandex交通資訊 + 感謝 Yandex 提供的交通資訊。 + Yandex 的交通資訊 導航路線 我的最愛 OSM 錯誤(線上) @@ -780,7 +763,7 @@ 選定的語音不能使用 SD卡無法存取。\n您將無法看到地圖或找地點。 - SD卡是唯讀。\n您只能看預載的地圖且無法由網路下載。 + SD 卡是唯讀模式。\n您只能看預載的地圖且無法由網路下載。 解壓縮檔案… 右轉之後直行 右後轉之後直行 @@ -847,14 +830,14 @@ 選擇線上或離線的導航服務 導航服務 SD卡上的儲存目錄不可存取 - 下載 {0} - {1} ? + 下載 {0} - {1}? 離線資料 {0}已存在 ({1})。您要更新 ({2})嗎 ? 地址 下載成功 存取發生錯誤 下載中… - 下載可以用的地區列表… + 正在下載可用的地區清單… 無法由 osmand.net 取得地區列表。 在地圖上顯示 我的最愛標點已被更改 @@ -869,14 +852,14 @@ 正在開啟異動清單… 正在結束異動清單… 送交節點… - 載入興趣點中… + 正在載入興趣點… 授權失敗 失敗 本地/英文名稱轉換中… - 載入道路/建物中… - 載入郵遞區號中… - 載入街道中… - 載入縣市中… + 正在載入道路/建物… + 正在載入郵遞區號… + 正在載入街道… + 正在載入縣市… 興趣點 儲存 GPX 時錯誤 @@ -888,7 +871,7 @@ 座標無效! 返回 OsmAnd 地圖 關閉 - 載入資料中… + 正在載入資料… 讀取裝置端資料中… 上次執行 OsmAnd 失敗!記錄檔為{0}。請回報這問題且附上該記錄檔。 儲存 GPX 軌跡到 SD 卡中… @@ -1069,7 +1052,7 @@ 排除路線 停止導航 清除目的地 - 現在 WiFi 並未連線。您想要使用目前的網際網路連線,繼續下載嗎? + 現在 WiFi 並未連線。您想要使用目前的網路連線繼續下載嗎? 街道 門牌號碼 旅程記錄 @@ -1199,14 +1182,14 @@ 原生記憶體總計由應用程式 %1$s MB (Dalvik %2$s MB,其它 %3$s MB) 。Proportional memory %4$s MB (Android 限制 %5$s MB,Dalvik %6$s MB)分配佔用。 設定為目的地 首先選擇城市或街道 - 還可下載 %1$d 個檔案 + 還可下載檔案 %1$d 次 關閉異動清單 ZXing 條碼掃描器應用程式未安裝。要在商場中的搜尋嗎? 捐贈後可在應用程式裡看到新的功能實現 沒有項目在 %1$s 未完成 - " OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式且免費,有世界各地和高品質的OpenStreetMap(簡稱 OSM 開放街道地圖)資料。所有地圖資料都可以存儲在您裝置的儲存卡上離線使用。透過您裝置的 GPS,OsmAnd 為汽車、自行車和行人,提供了路線、視覺和語音導航。所有的主要功能,工作於線上和離線這兩方面(無需網路連線)。 一些主要功能: 導航 - 工作在線上(快速)或是離線(當您在國外無需國際漫遊費用) - 轉向建議(turn by turn)語音導航(真人語音和合成音) - 可選的車道導引、街道名稱顯示和預計抵達時間 - 支援您的行程安排上的中途點 - 每當您偏離了行駛路線,自動重新改道規劃 - 查尋地點按照地址,類型(例如:餐廳、飯店、加油站、博物館),或以地圖地理位置坐標查看 地圖顯示 - 在地圖上顯示您的位置和方向 - 可以選擇地圖正北朝上或您的或行進方向朝上 - 儲存您最重要的地方,作為我的最愛 - 顯示您周遭的POI(興趣點) - 能顯示專用的線上地圖圖磚 - 可以顯示衛星視圖(來自 Bing) - 可顯示使用自訂不同透明度疊加的多種地圖層如遊覽/導航 GPX 軌跡 - 可選擇顯示地名於英文、裝置端或拼音拼法 使用 OpenStreetMap 和維基百科的資料: - 世界性最好的合作專案所得的高品質資訊 - 全球性的地圖 OpenStreetMap,可用在每個國家或地區 - 維基百科觀光景點,非常適合觀光旅遊(免費版本不提供) - 直接從應用程式,無限制的免費下載(在免費版下載限制 16 個地圖檔) - 始終保持最新的地圖(每月至少更新一次) - 簡潔細致的離線向量地圖 - 可在完整地圖資料還是只有公路網之間選擇(例如:全日本有700 MB或200 MB的公路網) - 還支援線上或快取地圖圖磚 安全功能 - 可選擇自動日/夜檢視切換 - 可選擇速限顯示功能,如果您超速了它會提醒 - 可選擇取決於速度的地圖縮放 - 分享您所在的位置的功能,這樣您的朋友能找到您 自行車和步行 - 地圖包括步行,徒步旅行,自行車道,非常適合戶外活動 - 特殊的自行車和行人的路線和顯示模式 - 可選的大眾運輸工具 (公共汽車、 電車、火車)包括線路名稱 - 可選的旅程記錄裝置端 GPX 檔案或線上服務 - 可選的速度和高度顯示 - 顯示等高線和地形陰影(經由附加的外掛元件) 直接提供給 OpenStreetMap - 報告地圖錯誤 - 直接從該應用程式上傳 GPX 軌跡到 OSM - 增加興趣點並直接上傳給 OSM(如果離線或在之後上傳) - 可選旅途中記錄而且在背景模式(當裝置處於休眠模式下) OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告錯誤、改進翻譯或編寫新的功能,每個人都可以作出貢獻。透過所有的這些形成開發人員和使用者交互的作用下,讓該專案處於不斷改善的活絡狀態。專案的開發進度、編寫程式碼和測試新的功能,還是要依靠提供資金捐款資助。藉由您幫忙購買 OsmAnd +,或者在 osmand.net 上做一般捐贈,應用程式的道路會更平坦、更棒!但也有可能資助特定的新功能。 大概的地圖覆蓋區域和品質: -西歐: * * * -東歐: * * * -俄羅斯: * * * -北美: * * * -南美洲: * * -亞洲: * * -日本 & 韓國: * * * -中東: * * -非洲: * * -南極洲: * 支援的國家的名單 (基本上世界範圍內!): 阿富汗、阿爾巴尼亞、阿爾及利亞、安道爾、安哥拉、安圭拉、安地卡及巴布達、阿根廷、亞美尼亞、阿路巴、澳大利亞、奧地利、亞塞拜然、巴哈馬、巴林、孟加拉國、巴巴多斯、白俄羅斯、比利時、貝里斯、貝寧、百慕達、不丹、玻利維亞、博內爾、波士尼亞和黑塞哥維那、博茨瓦納、巴西、英屬維爾京群島、汶萊、保加利亞、布吉納法索、蒲隆地、柬埔寨、喀麥隆、加拿大、維德角、中非共和國、查德、智利、中國、哥倫比亞、科摩羅、剛果、哥斯大黎加、象牙海岸、克羅地亞、古巴、庫拉索、賽普勒斯、捷克共和國、丹麥、吉布地、多米尼克、多明尼加共和國、厄瓜多爾、埃及、薩爾瓦多、赤道幾內亞、厄立特里亞、愛沙尼亞、埃塞俄比亞、斐濟、芬蘭、法國、法屬圭亞那、法屬玻里尼西亞、加蓬、岡比亞、格魯吉亞、德國、加納、直布羅陀、希臘、格陵蘭島、格瑞那達、哥德洛普島、關島、瓜地馬拉、根西島、幾內亞、幾內亞比索、蓋亞納、海地、梵蒂岡、宏都拉斯、香港、匈牙利、冰島、印度、印尼、伊朗、伊拉克、愛爾蘭、曼城島、以色列、義大利、牙買加、日本、澤西島、約旦、哈薩克斯坦、肯雅、吉里巴斯、朝鮮和韓國、科威特、吉爾吉斯斯坦、老撾、拉脫維亞、黎巴嫩、賴索托、賴比瑞亞、利比亞、列支敦斯登、立陶宛、盧森堡、澳門、馬其頓、馬達加斯加、馬拉威、馬來西亞、馬爾地夫、馬里、馬爾他、馬丁尼克島、茅利塔尼亞、模里西斯、馬約特、墨西哥、密克羅尼西亞聯邦、摩爾多瓦、摩納哥、蒙古、黑山、蒙特塞拉特、摩洛哥、莫三比克、緬甸、納米比亞、瑙魯、尼泊爾、荷蘭、荷屬安地列斯群島、新赫里多尼亞、紐西蘭、尼加拉瓜、尼日爾、奈及利亞、挪威、阿曼、巴基斯坦、帕勞、巴勒斯坦領土、巴拿馬、巴布亞紐幾內亞、巴拉圭、秘魯、菲律賓、波蘭、葡萄牙、波多黎各、卡塔爾、羅馬尼亞、俄羅斯、盧安達、聖巴泰勒米、聖海倫娜、聖基茨和尼維斯、聖露西亞、聖馬丁島、聖匹島、聖文森及格瑞那丁、薩摩亞、聖馬利諾、沙烏地阿拉伯、塞內加爾、塞爾維亞、塞席爾、塞拉里昂、新加坡、斯洛伐克、斯洛維尼亞、索馬里、南非、格魯吉亞的南、南蘇丹、西班牙、斯里蘭卡、蘇丹、蘇利南、史瓦濟蘭、瑞典、瑞士、敘利亞、臺灣、塔吉克斯坦、坦尚尼亞、泰國、東帝汶、多哥、托克勞、湯加、特立尼達和多巴哥、突尼斯、土耳其、土庫曼斯坦、吐瓦魯、烏干達、烏克蘭、阿拉伯聯合大公國、英國、美國、烏拉圭、烏茲別克斯坦、瓦努阿圖、委內瑞拉、越南、瓦利斯群島和富圖納群島、西撒哈拉、葉門、尚比亞、辛巴威。 " - " OsmAnd + 是付費應用程式版本。經由您的購買來支援專案,資金用在開發新的功能和接收最新的更新。您可以在購買前,先安裝名稱為 OsmAnd 的免費版本去試用該應用程式。 一些主要功能: 導航 - 工作在線上(快速)或是離線(當您在國外無需國際漫遊費用) - 轉向建議(turn by turn)語音導航(真人語音和合成音) - 可選擇車道導引、街道名稱顯示和預計抵達時間 - 支援您的行程安排上的中途點 - 每當您偏離了行駛路線,自動重新改道規劃 - 查尋地點按照地址,類型(例如:餐廳、飯店、加油站、博物館),或以地圖地理位置坐標查看 地圖顯示 - 在地圖上顯示您的位置和方向 - 可以選擇地圖正北朝上或您的或行進方向朝上 - 儲存您最重要的地方,作為我的最愛 - 顯示您周遭的 POI(興趣點) - 能顯示專用的線上地圖圖磚 - 可以顯示衛星視圖(來自 Bing) - 可顯示使用自訂不同透明度疊加的多種地圖層如遊覽/導航 GPX 軌跡 - 可選擇顯示地名於英文、裝置端或拼音拼法 使用 OpenStreetMap 和維基百科的資料: - 世界性最好的合作專案所得的高品質資訊 - 全球性的地圖 OpenStreetMap,可用在每個國家或地區 - 維基百科觀光景點,非常適合觀光旅遊 - 直接從應用程式,無限制的免費下載 - 始終保持最新的地圖(每月至少更新一次) - 簡潔細致的離線向量地圖 - 可在完整地圖資料還是只有公路網之間選擇(例如:全日本有700 MB或200 MB的公路網) - 還支援線上或快取地圖圖磚 安全功能 - 可選的自動日/夜檢視切換 - 可選的速限顯示功能,如果您超速了它會提醒 - 可選的取決於速度的地圖縮放 - 分享您所在的位置的功能,這樣您的朋友能找到您 自行車和步行 - 地圖包括步行,徒步旅行,自行車道,非常適合戶外活動 - 特殊的自行車和行人的路線和顯示模式 - 可選的大眾運輸工具 (公共汽車、 電車、火車)包括線路名稱 - 可選擇旅程記錄到裝置端 GPX 檔案或線上服務 - 可選的速度和高度顯示 - 顯示等高線和地形陰影(經由附加的外掛元件) 直接提供給 OpenStreetMap - 報告地圖錯誤 - 直接從該應用程式上傳 GPX 軌跡到 OSM - 增加興趣點並直接上傳給 OSM (如果離線或在之後上傳) - 可選旅途中記錄而且在背景模式(當裝置處於休眠模式下) OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告錯誤、改進翻譯或編寫新的功能,每個人都可以作出貢獻。透過所有的這些形成開發人員和使用者交互的作用下,讓該專案處於不斷改善的活絡狀態。專案的開發進度、編寫程式碼和測試新的功能,還是要依靠提供資金捐款資助。藉由您幫忙購買 OsmAnd +,或者在 osmand.net 上做一般捐贈,應用程式的道路會更平坦、更棒!但也有可能資助特定的新功能。 大概的地圖覆蓋區域和品質: -西歐: * * * -東歐: * * * -俄羅斯: * * * -北美: * * * -南美洲: * * -亞洲: * * -日本 & 韓國: * * * -中東: * * -非洲: * * -南極洲: * 支援的國家的名單 (基本上世界範圍內!): 阿富汗、阿爾巴尼亞、阿爾及利亞、安道爾、安哥拉、安圭拉、安地卡及巴布達、阿根廷、亞美尼亞、阿路巴、澳大利亞、奧地利、亞塞拜然、巴哈馬、巴林、孟加拉國、巴巴多斯、白俄羅斯、比利時、貝里斯、貝寧、百慕達、不丹、玻利維亞、博內爾、波士尼亞和黑塞哥維那、博茨瓦納、巴西、英屬維爾京群島、汶萊、保加利亞、布吉納法索、蒲隆地、柬埔寨、喀麥隆、加拿大、維德角、中非共和國、查德、智利、中國、哥倫比亞、科摩羅、剛果、哥斯大黎加、象牙海岸、克羅地亞、古巴、庫拉索、賽普勒斯、捷克共和國、丹麥、吉布地、多米尼克、多明尼加共和國、厄瓜多爾、埃及、薩爾瓦多、赤道幾內亞、厄立特里亞、愛沙尼亞、埃塞俄比亞、斐濟、芬蘭、法國、法屬圭亞那、法屬玻里尼西亞、加蓬、岡比亞、格魯吉亞、德國、加納、直布羅陀、希臘、格陵蘭島、格瑞那達、哥德洛普島、關島、瓜地馬拉、根西島、幾內亞、幾內亞比索、蓋亞納、海地、梵蒂岡、宏都拉斯、香港、匈牙利、冰島、印度、印尼、伊朗、伊拉克、愛爾蘭、曼城島、以色列、義大利、牙買加、日本、澤西島、約旦、哈薩克斯坦、肯雅、吉里巴斯、朝鮮和韓國、科威特、吉爾吉斯斯坦、老撾、拉脫維亞、黎巴嫩、賴索托、賴比瑞亞、利比亞、列支敦斯登、立陶宛、盧森堡、澳門、馬其頓、馬達加斯加、馬拉威、馬來西亞、馬爾地夫、馬里、馬爾他、馬丁尼克島、茅利塔尼亞、模里西斯、馬約特、墨西哥、密克羅尼西亞聯邦、摩爾多瓦、摩納哥、蒙古、黑山、蒙特塞拉特、摩洛哥、莫三比克、緬甸、納米比亞、瑙魯、尼泊爾、荷蘭、荷屬安地列斯群島、新赫里多尼亞、紐西蘭、尼加拉瓜、尼日爾、奈及利亞、挪威、阿曼、巴基斯坦、帕勞、巴勒斯坦領土、巴拿馬、巴布亞紐幾內亞、巴拉圭、秘魯、菲律賓、波蘭、葡萄牙、波多黎各、卡塔爾、羅馬尼亞、俄羅斯、盧安達、聖巴泰勒米、聖海倫娜、聖基茨和尼維斯、聖露西亞、聖馬丁島、聖匹島、聖文森及格瑞那丁、薩摩亞、聖馬利諾、沙烏地阿拉伯、塞內加爾、塞爾維亞、塞席爾、塞拉里昂、新加坡、斯洛伐克、斯洛維尼亞、索馬里、南非、格魯吉亞的南、南蘇丹、西班牙、斯里蘭卡、蘇丹、蘇利南、史瓦濟蘭、瑞典、瑞士、敘利亞、臺灣、塔吉克斯坦、坦尚尼亞、泰國、東帝汶、多哥、托克勞、湯加、特立尼達和多巴哥、突尼斯、土耳其、土庫曼斯坦、吐瓦魯、烏干達、烏克蘭、阿拉伯聯合大公國、英國、美國、烏拉圭、烏茲別克斯坦、瓦努阿圖、委內瑞拉、越南、瓦利斯群島和富圖納群島、西撒哈拉、葉門、尚比亞、辛巴威。 " + " OsmAnd (Automated Navigation Directions) 是一個地圖和導航的應用程式且免費,有世界各地和高品質的OpenStreetMap(簡稱 OSM 開放街道地圖)資料。所有地圖資料都可以存儲在您裝置的儲存卡上離線使用。透過您裝置的 GPS,OsmAnd 為汽車、自行車和行人,提供了路線、視覺和語音導航。所有的主要功能,工作於線上和離線這兩方面(無需網路連線)。 一些主要功能: 導航 - 工作在線上(快速)或是離線(當您在國外無需國際漫遊費用) - 轉向建議(turn by turn)語音導航(真人語音和合成音) - 可選的車道導引、街道名稱顯示和預計抵達時間 - 支援您的行程安排上的中途點 - 每當您偏離了行駛路線,自動重新改道規劃 - 查尋地點按照地址,類型(例如:餐廳、飯店、加油站、博物館),或以地圖地理位置坐標查看 地圖顯示 - 在地圖上顯示您的位置和方向 - 可以選擇地圖正北朝上或您的或行進方向朝上 - 儲存您最重要的地方,作為我的最愛 - 顯示您周遭的POI(興趣點) - 能顯示專用的線上地圖圖磚 - 可以顯示衛星視圖(來自 Bing) - 可顯示使用自訂不同透明度疊加的多種地圖層如遊覽/導航 GPX 軌跡 - 可選擇顯示地名於英文、裝置端或拼音拼法 使用 OpenStreetMap 和維基百科的資料: - 世界性最好的合作專案所得的高品質資訊 - 全球性的地圖 OpenStreetMap,可用在每個國家或地區 - 維基百科觀光景點,非常適合觀光旅遊(免費版本不提供) - 直接從應用程式,無限制的免費下載(在免費版下載限制 16 個地圖檔) - 始終保持最新的地圖(每月至少更新一次) - 簡潔細致的離線向量地圖 - 可在完整地圖資料還是只有公路網之間選擇(例如:全日本有700 MB或200 MB的公路網) - 還支援線上或快取地圖圖磚 安全功能 - 自動日/夜檢視切換選項 - 速限顯示功能選項,如果您超速了它會提醒 - 可選擇取決於速度的地圖縮放 - 分享您所在的位置的功能,這樣您的朋友能找到您 自行車和步行 - 地圖包括步行,徒步旅行,自行車道,非常適合戶外活動 - 特殊的自行車和行人的路線和顯示模式 - 大眾運輸工具選項 (公共汽車、 電車、火車)包括線路名稱 - 可選的旅程記錄裝置端 GPX 檔案或線上服務 - 速度和高度顯示選項 - 顯示等高線和地形陰影(經由附加的外掛元件) 直接提供給 OpenStreetMap - 報告地圖錯誤 - 直接從該應用程式上傳 GPX 軌跡到 OSM - 增加興趣點並直接上傳給 OSM(如果離線或在之後上傳) - 可選旅途中記錄而且在背景模式(當裝置處於休眠模式下) OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告錯誤、改進翻譯或編寫新的功能,每個人都可以作出貢獻。透過所有的這些形成開發人員和使用者交互的作用下,讓該專案處於不斷改善的活絡狀態。專案的開發進度、編寫程式碼和測試新的功能,還是要依靠提供資金捐款資助。藉由您幫忙購買 OsmAnd +,或者在 osmand.net 上做一般捐贈,應用程式的道路會更平坦、更棒!但也有可能資助特定的新功能。 大概的地圖覆蓋區域和品質: -西歐: * * * -東歐: * * * -俄羅斯: * * * -北美: * * * -南美洲: * * -亞洲: * * -日本 & 韓國: * * * -中東: * * -非洲: * * -南極洲: * 支援的國家的名單 (基本上世界範圍內!): 阿富汗、阿爾巴尼亞、阿爾及利亞、安道爾、安哥拉、安圭拉、安地卡及巴布達、阿根廷、亞美尼亞、阿路巴、澳大利亞、奧地利、亞塞拜然、巴哈馬、巴林、孟加拉國、巴巴多斯、白俄羅斯、比利時、貝里斯、貝寧、百慕達、不丹、玻利維亞、博內爾、波士尼亞和黑塞哥維那、博茨瓦納、巴西、英屬維爾京群島、汶萊、保加利亞、布吉納法索、蒲隆地、柬埔寨、喀麥隆、加拿大、維德角、中非共和國、查德、智利、中國、哥倫比亞、科摩羅、剛果、哥斯大黎加、象牙海岸、克羅地亞、古巴、庫拉索、賽普勒斯、捷克共和國、丹麥、吉布地、多米尼克、多明尼加共和國、厄瓜多爾、埃及、薩爾瓦多、赤道幾內亞、厄立特里亞、愛沙尼亞、埃塞俄比亞、斐濟、芬蘭、法國、法屬圭亞那、法屬玻里尼西亞、加蓬、岡比亞、格魯吉亞、德國、加納、直布羅陀、希臘、格陵蘭島、格瑞那達、哥德洛普島、關島、瓜地馬拉、根西島、幾內亞、幾內亞比索、蓋亞納、海地、梵蒂岡、宏都拉斯、香港、匈牙利、冰島、印度、印尼、伊朗、伊拉克、愛爾蘭、曼城島、以色列、義大利、牙買加、日本、澤西島、約旦、哈薩克斯坦、肯雅、吉里巴斯、朝鮮和韓國、科威特、吉爾吉斯斯坦、老撾、拉脫維亞、黎巴嫩、賴索托、賴比瑞亞、利比亞、列支敦斯登、立陶宛、盧森堡、澳門、馬其頓、馬達加斯加、馬拉威、馬來西亞、馬爾地夫、馬里、馬爾他、馬丁尼克島、茅利塔尼亞、模里西斯、馬約特、墨西哥、密克羅尼西亞聯邦、摩爾多瓦、摩納哥、蒙古、黑山、蒙特塞拉特、摩洛哥、莫三比克、緬甸、納米比亞、瑙魯、尼泊爾、荷蘭、荷屬安地列斯群島、新赫里多尼亞、紐西蘭、尼加拉瓜、尼日爾、奈及利亞、挪威、阿曼、巴基斯坦、帕勞、巴勒斯坦領土、巴拿馬、巴布亞紐幾內亞、巴拉圭、秘魯、菲律賓、波蘭、葡萄牙、波多黎各、卡塔爾、羅馬尼亞、俄羅斯、盧安達、聖巴泰勒米、聖海倫娜、聖基茨和尼維斯、聖露西亞、聖馬丁島、聖匹島、聖文森及格瑞那丁、薩摩亞、聖馬利諾、沙烏地阿拉伯、塞內加爾、塞爾維亞、塞席爾、塞拉里昂、新加坡、斯洛伐克、斯洛維尼亞、索馬里、南非、格魯吉亞的南、南蘇丹、西班牙、斯里蘭卡、蘇丹、蘇利南、史瓦濟蘭、瑞典、瑞士、敘利亞、臺灣、塔吉克斯坦、坦尚尼亞、泰國、東帝汶、多哥、托克勞、湯加、特立尼達和多巴哥、突尼斯、土耳其、土庫曼斯坦、吐瓦魯、烏干達、烏克蘭、阿拉伯聯合大公國、英國、美國、烏拉圭、烏茲別克斯坦、瓦努阿圖、委內瑞拉、越南、瓦利斯群島和富圖納群島、西撒哈拉、葉門、尚比亞、辛巴威。 " + " OsmAnd + 是付費應用程式版本。經由您的購買來支援專案,資金用在開發新的功能和接收最新的更新。您可以在購買前,先安裝名稱為 OsmAnd 的免費版本去試用該應用程式。 一些主要功能: 導航 - 工作在線上(快速)或是離線(當您在國外無需國際漫遊費用) - 轉向建議(turn by turn)語音導航(真人語音和合成音) - 可選擇車道導引、街道名稱顯示和預計抵達時間 - 支援您的行程安排上的中途點 - 每當您偏離了行駛路線,自動重新改道規劃 - 查尋地點按照地址,類型(例如:餐廳、飯店、加油站、博物館),或以地圖地理位置坐標查看 地圖顯示 - 在地圖上顯示您的位置和方向 - 可以選擇地圖正北朝上或您的或行進方向朝上 - 儲存您最重要的地方,作為我的最愛 - 顯示您周遭的 POI(興趣點) - 能顯示專用的線上地圖圖磚 - 可以顯示衛星視圖(來自 Bing) - 可顯示使用自訂不同透明度疊加的多種地圖層如遊覽/導航 GPX 軌跡 - 可選擇顯示地名於英文、裝置端或拼音拼法 使用 OpenStreetMap 和維基百科的資料: - 世界性最好的合作專案所得的高品質資訊 - 全球性的地圖 OpenStreetMap,可用在每個國家或地區 - 維基百科觀光景點,非常適合觀光旅遊 - 直接從應用程式,無限制的免費下載 - 始終保持最新的地圖(每月至少更新一次) - 簡潔細致的離線向量地圖 - 可在完整地圖資料還是只有公路網之間選擇(例如:全日本有700 MB或200 MB的公路網) - 還支援線上或快取地圖圖磚 安全功能 - 自動日/夜檢視切換選項 - 速限顯示功能選項,如果您超速了它會提醒 - 取決於速度的地圖縮放選項 - 分享您所在的位置的功能,這樣您的朋友能找到您 自行車和步行 - 地圖包括步行,徒步旅行,自行車道,非常適合戶外活動 - 特殊的自行車和行人的路線和顯示模式 - 大眾運輸工具選項 (公共汽車、 電車、火車)包括線路名稱 - 可選擇旅程記錄到裝置端 GPX 檔案或線上服務 - 可選的速度和高度顯示 - 顯示等高線和地形陰影(經由附加的外掛元件) 直接提供給 OpenStreetMap - 報告地圖錯誤 - 直接從該應用程式上傳 GPX 軌跡到 OSM - 增加興趣點並直接上傳給 OSM (如果離線或在之後上傳) - 可選旅途中記錄而且在背景模式(當裝置處於休眠模式下) OsmAnd 是開放原始碼,而且正在積極的開發。應用程式從報告錯誤、改進翻譯或編寫新的功能,每個人都可以作出貢獻。透過所有的這些形成開發人員和使用者交互的作用下,讓該專案處於不斷改善的活絡狀態。專案的開發進度、編寫程式碼和測試新的功能,還是要依靠提供資金捐款資助。藉由您幫忙購買 OsmAnd +,或者在 osmand.net 上做一般捐贈,應用程式的道路會更平坦、更棒!但也有可能資助特定的新功能。 大概的地圖覆蓋區域和品質: -西歐: * * * -東歐: * * * -俄羅斯: * * * -北美: * * * -南美洲: * * -亞洲: * * -日本 & 韓國: * * * -中東: * * -非洲: * * -南極洲: * 支援的國家的名單 (基本上世界範圍內!): 阿富汗、阿爾巴尼亞、阿爾及利亞、安道爾、安哥拉、安圭拉、安地卡及巴布達、阿根廷、亞美尼亞、阿路巴、澳大利亞、奧地利、亞塞拜然、巴哈馬、巴林、孟加拉國、巴巴多斯、白俄羅斯、比利時、貝里斯、貝寧、百慕達、不丹、玻利維亞、博內爾、波士尼亞和黑塞哥維那、博茨瓦納、巴西、英屬維爾京群島、汶萊、保加利亞、布吉納法索、蒲隆地、柬埔寨、喀麥隆、加拿大、維德角、中非共和國、查德、智利、中國、哥倫比亞、科摩羅、剛果、哥斯大黎加、象牙海岸、克羅地亞、古巴、庫拉索、賽普勒斯、捷克共和國、丹麥、吉布地、多米尼克、多明尼加共和國、厄瓜多爾、埃及、薩爾瓦多、赤道幾內亞、厄立特里亞、愛沙尼亞、埃塞俄比亞、斐濟、芬蘭、法國、法屬圭亞那、法屬玻里尼西亞、加蓬、岡比亞、格魯吉亞、德國、加納、直布羅陀、希臘、格陵蘭島、格瑞那達、哥德洛普島、關島、瓜地馬拉、根西島、幾內亞、幾內亞比索、蓋亞納、海地、梵蒂岡、宏都拉斯、香港、匈牙利、冰島、印度、印尼、伊朗、伊拉克、愛爾蘭、曼城島、以色列、義大利、牙買加、日本、澤西島、約旦、哈薩克斯坦、肯雅、吉里巴斯、朝鮮和韓國、科威特、吉爾吉斯斯坦、老撾、拉脫維亞、黎巴嫩、賴索托、賴比瑞亞、利比亞、列支敦斯登、立陶宛、盧森堡、澳門、馬其頓、馬達加斯加、馬拉威、馬來西亞、馬爾地夫、馬里、馬爾他、馬丁尼克島、茅利塔尼亞、模里西斯、馬約特、墨西哥、密克羅尼西亞聯邦、摩爾多瓦、摩納哥、蒙古、黑山、蒙特塞拉特、摩洛哥、莫三比克、緬甸、納米比亞、瑙魯、尼泊爾、荷蘭、荷屬安地列斯群島、新赫里多尼亞、紐西蘭、尼加拉瓜、尼日爾、奈及利亞、挪威、阿曼、巴基斯坦、帕勞、巴勒斯坦領土、巴拿馬、巴布亞紐幾內亞、巴拉圭、秘魯、菲律賓、波蘭、葡萄牙、波多黎各、卡塔爾、羅馬尼亞、俄羅斯、盧安達、聖巴泰勒米、聖海倫娜、聖基茨和尼維斯、聖露西亞、聖馬丁島、聖匹島、聖文森及格瑞那丁、薩摩亞、聖馬利諾、沙烏地阿拉伯、塞內加爾、塞爾維亞、塞席爾、塞拉里昂、新加坡、斯洛伐克、斯洛維尼亞、索馬里、南非、格魯吉亞的南、南蘇丹、西班牙、斯里蘭卡、蘇丹、蘇利南、史瓦濟蘭、瑞典、瑞士、敘利亞、臺灣、塔吉克斯坦、坦尚尼亞、泰國、東帝汶、多哥、托克勞、湯加、特立尼達和多巴哥、突尼斯、土耳其、土庫曼斯坦、吐瓦魯、烏干達、烏克蘭、阿拉伯聯合大公國、英國、美國、烏拉圭、烏茲別克斯坦、瓦努阿圖、委內瑞拉、越南、瓦利斯群島和富圖納群島、西撒哈拉、葉門、尚比亞、辛巴威。 " 刪除標點 標點 清除所有的標點 @@ -1216,7 +1199,7 @@ 在到達目的地之間路途上,沿路的中途點已採取了最佳化的排列。 這個外掛元件提供了等高線,可以在 OsmAnd 的離線地圖中顯示。全球圖資(在北緯 70 度至南緯 70 度之間)的量測基礎在於 SRTM (Shuttle Radar Topography Mission)和 ASTER (Advanced Spaceborne Thermal Emission and Reflection Radiometer),遙測儀器安裝在美國太空總署地球觀測系統的旗艦衛星 Terra 上,ASTER 是美國太空總署、日本經濟產業省(METI)、日本太空系統 (J-spacesystems)之間的通力合作產物。 以位置去關聯的注解尚未下定義。\"使用位置 …\",把注解分配給指定的位置 - 便於下載目前離線的等高線和地形陰影(\'設定\' -> \'管理地圖檔案\' -> \'下載\' -> 選擇所需的地圖類型)。 + 簡易下載離線的等高線和地形陰影(\'設定\' -> \'管理地圖檔案\' -> \'下載\' -> 選擇所需的地圖類型)。 在0.7.2的變更: \n\t- Native rendering for all devices \n\t- Offline POI editing @@ -1703,7 +1686,7 @@ %1$s \n個標點 %1$s \n軌跡 %2$s 正在錄制的軌跡 - 載入 %1$s … + 正在載入 %1$s … 目前時間 \n\n長按在地圖上查看 自動啟動轉向建議指引 @@ -1735,7 +1718,7 @@ OsMo 服務 OsMo 軌跡 %1$s 已下載。 輸入邀請 - " - 所有建立的群組都是公開的!如果您希望匿名,透過追蹤 IDS 直接連接裝置。\n - 群組可以註冊多達16人。\n - 假使閒置或僅一人於二個星期裡活動,那群組將會被刪除。\n - 因為只能靠邀請,您可以限制群組的進入,但要控管群組您需要去管理主控台。\n - 如果您需要建立一個群組,但是具有其它條件,請連絡 http://osmo.mobi" + " - 所有建立的群組都是公開的!如果您希望匿名,可透過追蹤的 IDS 直接連接裝置。\n - 群組可以註冊多達16人。\n - 假使閒置或僅一人於二個星期裡活動,那群組將會被刪除。\n - 因為只能靠邀請,您可以限制群組的進入,但要控管群組您需要去管理主控台。\n - 如果您需要建立一個群組,但是具有其它條件,請連絡 http://osmo.mobi" 請在建立群組之前,仔細閱讀! OsMo 登入失敗 授權失敗 @@ -1804,7 +1787,7 @@ 自行車 步行 更多... - 要下載缺少的地圖 %1$ s (%2$ d MB) 嗎? + 要下載缺少的地圖 %1$s (%2$d MB) 嗎? 全部 中途點 目的地 @@ -1833,4 +1816,6 @@ 測速照相 交通流量警示 點觸任何現有的項目,查看更詳細的資訊,長按則停用或刪除。目前在裝置上的資料有 (%1$s 可用): - + 設定地圖上的文字大小。 + 文字大小 + diff --git a/OsmAnd/res/values/sherpafy.xml b/OsmAnd/res/values/sherpafy.xml index 12d2c5fd4b..86df723498 100644 --- a/OsmAnd/res/values/sherpafy.xml +++ b/OsmAnd/res/values/sherpafy.xml @@ -14,6 +14,7 @@ Map Info Important Info + Hide POI on map Stages Tour Information Key facts and contact info diff --git a/OsmAnd/res/values/strings.xml b/OsmAnd/res/values/strings.xml index 0eda56ca63..e036582800 100644 --- a/OsmAnd/res/values/strings.xml +++ b/OsmAnd/res/values/strings.xml @@ -9,6 +9,8 @@ 3. All your modified/created strings are in the top of the file (to make easier find what\'s translated). PLEASE: Have a look at http://code.google.com/p/osmand/wiki/UIConsistency, it may really improve your and our work :-) Thx - Hardy --> + Set the text size on the map. + Text size Speed limit Border control Toll booth diff --git a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java b/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java index 2c60fd6800..b3be541fe9 100644 --- a/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java +++ b/OsmAnd/src/net/osmand/access/SettingsAccessibilityActivity.java @@ -9,6 +9,7 @@ import android.os.Build; import android.os.Bundle; import android.preference.ListPreference; import android.preference.Preference; +import android.preference.PreferenceGroup; import android.preference.Preference.OnPreferenceChangeListener; import android.preference.PreferenceCategory; import android.preference.PreferenceScreen; @@ -41,6 +42,8 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity { return true; } }); + addTextScale(grp); + addSpeechRateSetting(grp); grp.addPreference(accessibilityModePreference); PreferenceCategory cat = new PreferenceCategory(this); @@ -69,15 +72,11 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity { cat.addPreference(createCheckBoxPreference(settings.ZOOM_BY_TRACKBALL, R.string.zoom_by_trackball, R.string.zoom_by_trackball_descr)); + cat.addPreference(createCheckBoxPreference(settings.USE_SHORT_OBJECT_NAMES, R.string.use_short_object_names, R.string.use_short_object_names_descr)); - Float[] sprValues = new Float[] {0.5f, 0.75f, 1f, 1.25f, 1.5f, 2f} ; - String[] sprNames = new String[sprValues.length]; - for(int i = 0; i < sprNames.length; i++) { - sprNames[i] = (int)(sprValues[i] * 100) + " %"; - } - cat.addPreference(createListPreference(settings.SPEECH_RATE, sprNames, sprValues, R.string.speech_rate, R.string.speech_rate_descr)); + if (Build.VERSION.SDK_INT < 14) { // Build.VERSION_CODES.ICE_CREAM_SANDWICH cat.addPreference(createCheckBoxPreference(settings.SCROLL_MAP_BY_GESTURES, R.string.scroll_map_by_gestures, R.string.scroll_map_by_gestures_descr)); @@ -88,6 +87,28 @@ public class SettingsAccessibilityActivity extends SettingsBaseActivity { + protected void addTextScale(PreferenceGroup grp) { + Float[] txtValues = new Float[] {0.75f, 1f, 1.25f, 1.5f, 2f, 3f} ; + String[] txtNames = new String[txtValues.length]; + for(int i = 0; i < txtNames.length; i++) { + txtNames[i] = (int)(txtValues[i] * 100) + " %"; + } + grp.addPreference(createListPreference(settings.TEXT_SCALE, txtNames, txtValues, R.string.text_size, R.string.text_size_descr)); + } + + + + protected void addSpeechRateSetting(PreferenceGroup grp) { + Float[] sprValues = new Float[] {0.5f, 0.75f, 1f, 1.25f, 1.5f, 2f} ; + String[] sprNames = new String[sprValues.length]; + for(int i = 0; i < sprNames.length; i++) { + sprNames[i] = (int)(sprValues[i] * 100) + " %"; + } + grp.addPreference(createListPreference(settings.SPEECH_RATE, sprNames, sprValues, R.string.speech_rate, R.string.speech_rate_descr)); + } + + + public void updateAllSettings() { super.updateAllSettings(); PreferenceCategory accessibilityOptions = ((PreferenceCategory)(getPreferenceScreen().findPreference("accessibility_options"))); diff --git a/OsmAnd/src/net/osmand/plus/OsmandApplication.java b/OsmAnd/src/net/osmand/plus/OsmandApplication.java index 3b1c2da2fd..5373bdbee8 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandApplication.java +++ b/OsmAnd/src/net/osmand/plus/OsmandApplication.java @@ -19,6 +19,7 @@ import net.osmand.access.AccessibleAlertBuilder; import net.osmand.access.AccessibleToast; import net.osmand.plus.access.AccessibilityMode; import net.osmand.plus.activities.*; +import net.osmand.plus.download.DownloadActivity; import net.osmand.plus.download.DownloadIndexFragment; import net.osmand.plus.api.SQLiteAPI; import net.osmand.plus.api.SQLiteAPIImpl; @@ -111,7 +112,7 @@ public class OsmandApplication extends Application { BRouterServiceConnection bRouterServiceConnection; MapActivity mapActivity; - DownloadIndexFragment downloadActivity; + DownloadActivity downloadActivity; @Override public void onCreate() { @@ -879,11 +880,11 @@ public class OsmandApplication extends Application { this.mapActivity = mapActivity; } - public void setDownloadActivity(DownloadIndexFragment downloadActivity) { + public void setDownloadActivity(DownloadActivity downloadActivity) { this.downloadActivity = downloadActivity; } - public DownloadIndexFragment getDownloadActivity() { + public DownloadActivity getDownloadActivity() { return downloadActivity; } } diff --git a/OsmAnd/src/net/osmand/plus/OsmandSettings.java b/OsmAnd/src/net/osmand/plus/OsmandSettings.java index 45584721eb..04c161b956 100644 --- a/OsmAnd/src/net/osmand/plus/OsmandSettings.java +++ b/OsmAnd/src/net/osmand/plus/OsmandSettings.java @@ -700,14 +700,19 @@ public class OsmandSettings { public final OsmandPreference USE_MAGNETIC_FIELD_SENSOR_COMPASS = new BooleanPreference("use_magnetic_field_sensor_compass", false).makeGlobal().cache(); public final OsmandPreference USE_KALMAN_FILTER_FOR_COMPASS = new BooleanPreference("use_kalman_filter_compass", true).makeGlobal().cache(); + public final CommonPreference TEXT_SCALE = new FloatPreference("text_scale", 1f).makeProfile().cache(); + { + TEXT_SCALE.setModeDefaultValue(ApplicationMode.CAR, 1.5f); + } + public final CommonPreference MAP_ZOOM_SCALE_BY_DENSITY = new FloatPreference("map_zoom_scale_wo_density", 0f).makeProfile().cache(); { MAP_ZOOM_SCALE_BY_DENSITY.setModeDefaultValue(ApplicationMode.CAR, 0.5f); } - public float getSettingsZoomScale(float density){ - // by default scale between [0, 1[ density (because of lots map complains) - return MAP_ZOOM_SCALE_BY_DENSITY.get() + (float)Math.sqrt(Math.max(0, density - 1)); + + public float getSettingsZoomScale(){ + return MAP_ZOOM_SCALE_BY_DENSITY.get() ; } diff --git a/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java b/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java index f529e8e33a..ad0164c1dd 100644 --- a/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java +++ b/OsmAnd/src/net/osmand/plus/audionotes/MediaRemoteControlReceiver.java @@ -4,17 +4,15 @@ import net.osmand.plus.OsmandPlugin; import android.content.BroadcastReceiver; import android.content.Context; import android.content.Intent; -import android.widget.Toast; public class MediaRemoteControlReceiver extends BroadcastReceiver { @Override public void onReceive(Context context, Intent intent) { - Toast.makeText(context, "Intent sent", Toast.LENGTH_LONG).show(); if (Intent.ACTION_MEDIA_BUTTON.equals(intent.getAction())) { AudioVideoNotesPlugin plugin = OsmandPlugin.getEnabledPlugin(AudioVideoNotesPlugin.class); if(plugin != null && intent.getParcelableExtra(Intent.EXTRA_KEY_EVENT) != null) { - System.out.println("OsmAnd AV Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0)); +// System.out.println("OsmAnd AV Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0)); // Toast.makeText(context, "Button pressed " + intent.getIntExtra(Intent.EXTRA_KEY_EVENT, 0), Toast.LENGTH_LONG).show(); } } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java index f610abcb64..e0dd7b0dd9 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadActivity.java @@ -9,6 +9,8 @@ import android.os.AsyncTask; import android.os.Build; import android.os.Bundle; import android.support.v4.app.Fragment; +import android.support.v4.app.NotificationCompat; +import android.support.v4.app.NotificationManagerCompat; import android.support.v4.view.ViewPager; import android.view.View; import android.widget.*; @@ -23,14 +25,12 @@ import net.osmand.plus.activities.SettingsGeneralActivity; import net.osmand.plus.base.BasicProgressAsyncTask; import net.osmand.plus.base.SuggestExternalDirectoryDialog; import net.osmand.plus.srtmplugin.SRTMPlugin; +import net.osmand.plus.voice.TTSCommandPlayerImpl; import java.io.File; import java.lang.ref.WeakReference; import java.text.MessageFormat; -import java.util.ArrayList; -import java.util.LinkedHashMap; -import java.util.List; -import java.util.Map; +import java.util.*; /** * Created by Denis on 08.09.2014. @@ -200,6 +200,7 @@ public class DownloadActivity extends SherlockFragmentActivity { @Override protected void onResume() { super.onResume(); + getMyApplication().setDownloadActivity(this); BasicProgressAsyncTask t = downloadListIndexThread.getCurrentRunningTask(); } @@ -521,8 +522,58 @@ public class DownloadActivity extends SherlockFragmentActivity { task.execute(); } + public Map getIndexFileNames() { return downloadListIndexThread != null ? downloadListIndexThread.getIndexFileNames() : null; } + public void showDialogToDownloadMaps(Collection maps) { + int count = 0; + int sz = 0; + String s = ""; + for (IndexItem i : DownloadActivity.downloadListIndexThread.getCachedIndexFiles()) { + for (String map : maps) { + if ((i.getFileName().equals(map + ".obf.zip") || i.getFileName().equals(map + "_" + IndexConstants.BINARY_MAP_VERSION + ".obf.zip")) + && i.getType() == DownloadActivityType.NORMAL_FILE) { + final List de = i.createDownloadEntry(getMyApplication(), i.getType(), new ArrayList(1)); + for(DownloadEntry d : de ) { + count++; + sz += d.sizeMB; + } + if(s.length() > 0) { + s +=", "; + } + s += i.getVisibleName(getMyApplication(), getMyApplication().getResourceManager().getOsmandRegions()); + getEntriesToDownload().put(i, de); + } + } + } + if(count > 0){ + AlertDialog.Builder builder = new AlertDialog.Builder(this); + builder.setMessage(getString(R.string.download_additional_maps, s, sz)); + builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { + @Override + public void onClick(DialogInterface dialog, int which) { + downloadFilesCheckInternet(); + } + }); + builder.setNegativeButton(R.string.default_buttons_no, new DialogInterface.OnClickListener() { + + @Override + public void onClick(DialogInterface dialog, int which) { + getEntriesToDownload().clear(); + } + }); + builder.setOnCancelListener(new DialogInterface.OnCancelListener() { + + @Override + public void onCancel(DialogInterface dialog) { + getEntriesToDownload().clear(); + } + }); + builder.show(); + + } + } + } diff --git a/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java b/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java index c871ff92ae..404dd69629 100644 --- a/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java +++ b/OsmAnd/src/net/osmand/plus/download/DownloadIndexFragment.java @@ -102,7 +102,6 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment { @Override public void onResume() { super.onResume(); - getMyApplication().setDownloadActivity(this); getDownloadActivity().updateProgress(false); BasicProgressAsyncTask t = DownloadActivity.downloadListIndexThread.getCurrentRunningTask(); if(t instanceof DownloadIndexesThread.DownloadIndexesAsyncTask) { @@ -113,55 +112,6 @@ public class DownloadIndexFragment extends OsmandExpandableListFragment { } } - public void showDialogToDownloadMaps(Collection maps) { - int count = 0; - int sz = 0; - String s = ""; - for (IndexItem i : DownloadActivity.downloadListIndexThread.getCachedIndexFiles()) { - for (String map : maps) { - if (i.getFileName().equals(map + ".obf.zip") && i.getType() == DownloadActivityType.NORMAL_FILE) { - final List de = i.createDownloadEntry(getMyApplication(), i.getType(), new ArrayList(1)); - for(DownloadEntry d : de ) { - count++; - sz += d.sizeMB; - } - if(s.length() > 0) { - s +=", "; - } - s += i.getVisibleName(getMyApplication(), getMyApplication().getResourceManager().getOsmandRegions()); - getDownloadActivity().getEntriesToDownload().put(i, de); - } - } - } - if(count > 0){ - Builder builder = new AlertDialog.Builder(getDownloadActivity()); - builder.setMessage(getString(R.string.download_additional_maps, s, sz)); - builder.setPositiveButton(R.string.default_buttons_yes, new DialogInterface.OnClickListener() { - @Override - public void onClick(DialogInterface dialog, int which) { - getDownloadActivity().downloadFilesCheckInternet(); - } - }); - builder.setNegativeButton(R.string.default_buttons_no, new DialogInterface.OnClickListener() { - - @Override - public void onClick(DialogInterface dialog, int which) { - getDownloadActivity().getEntriesToDownload().clear(); - } - }); - builder.setOnCancelListener(new DialogInterface.OnCancelListener() { - - @Override - public void onCancel(DialogInterface dialog) { - getDownloadActivity().getEntriesToDownload().clear(); - } - }); - builder.show(); - - } - } - - @Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == RELOAD_ID) { diff --git a/OsmAnd/src/net/osmand/plus/helpers/SimpleTwoFingerTapDetector.java b/OsmAnd/src/net/osmand/plus/helpers/SimpleTwoFingerTapDetector.java index 8ed9667fe2..b5a7cfec73 100644 --- a/OsmAnd/src/net/osmand/plus/helpers/SimpleTwoFingerTapDetector.java +++ b/OsmAnd/src/net/osmand/plus/helpers/SimpleTwoFingerTapDetector.java @@ -1,7 +1,5 @@ package net.osmand.plus.helpers; -import android.annotation.TargetApi; -import android.os.Build; import android.view.MotionEvent; import android.view.ViewConfiguration; diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoControlDevice.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoControlDevice.java index a14b1493a2..a4fb9fbe96 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoControlDevice.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoControlDevice.java @@ -112,6 +112,8 @@ public class OsMoControlDevice implements OsMoReactor { return true; } else if(command.equals("TP")) { plugin.getDownloadGpxTask(true).execute(obj); + } else if (command.equals("PP")) { + service.pushCommand("PP"); } return false; } diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java index baf37096b7..cd5ef7f654 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoPositionLayer.java @@ -168,9 +168,9 @@ public class OsMoPositionLayer extends OsmandMapLayer implements ContextMenuLaye if (!pos.isEmpty()) { StringBuilder res = new StringBuilder(); for (OsMoDevice d : pos) { - res.append(getObjectDescription(d)); + res.append(getObjectDescription(d)).append("\n"); } - AccessibleToast.makeText(view.getContext(), res.toString(), Toast.LENGTH_LONG).show(); + AccessibleToast.makeText(view.getContext(), res.toString().trim(), Toast.LENGTH_LONG).show(); return true; } return false; diff --git a/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java b/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java index f638ac093c..b6730bc16b 100644 --- a/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java +++ b/OsmAnd/src/net/osmand/plus/osmo/OsMoThread.java @@ -165,7 +165,7 @@ public class OsMoThread { } } catch (Exception e) { log.info("Exception selecting socket", e); - cmd("ERROR HEARTBEAT", true); + cmd("ERROR HEARTBEAT" + e.getMessage(), true); e.printStackTrace(); if (activeChannel != null && !activeChannel.isConnected()) { activeChannel = null; diff --git a/OsmAnd/src/net/osmand/plus/osmodroid/ColoredGPX.java b/OsmAnd/src/net/osmand/plus/osmodroid/ColoredGPX.java deleted file mode 100644 index 7a348dd710..0000000000 --- a/OsmAnd/src/net/osmand/plus/osmodroid/ColoredGPX.java +++ /dev/null @@ -1,8 +0,0 @@ -package net.osmand.plus.osmodroid; - -import net.osmand.plus.GPXUtilities.GPXFile; - -public class ColoredGPX { - int color; - GPXFile gpxFile; -} diff --git a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidLayer.java b/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidLayer.java deleted file mode 100644 index d467c0faf4..0000000000 --- a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidLayer.java +++ /dev/null @@ -1,385 +0,0 @@ -package net.osmand.plus.osmodroid; - -import java.util.ArrayList; -import java.util.List; - -import net.osmand.access.AccessibleToast; -import net.osmand.data.LatLon; -import net.osmand.data.QuadRect; -import net.osmand.data.RotatedTileBox; -import net.osmand.plus.*; -import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; -import net.osmand.plus.GPXUtilities.GPXFile; -import net.osmand.plus.GPXUtilities.WptPt; -import net.osmand.plus.activities.MapActivity; -import net.osmand.plus.views.ContextMenuLayer; -import net.osmand.plus.views.GPXLayer; -import net.osmand.plus.views.OsmandMapLayer; -import net.osmand.plus.views.OsmandMapTileView; -import net.osmand.plus.views.OsmandMapLayer.DrawSettings; -import net.osmand.render.RenderingRuleSearchRequest; -import net.osmand.render.RenderingRulesStorage; -import android.content.Context; -import android.graphics.Bitmap; -import android.graphics.BitmapFactory; -import android.graphics.Canvas; -import android.graphics.Color; -import android.graphics.Paint; -import android.graphics.Path; -import android.graphics.PointF; -import android.graphics.Rect; -import android.graphics.Typeface; -import android.graphics.Paint.Cap; -import android.graphics.Paint.Join; -import android.graphics.Paint.Style; -import android.os.RemoteException; -import android.util.DisplayMetrics; -import android.view.WindowManager; -import android.widget.Toast; -import android.content.DialogInterface; - -/** - * Class represents a OsMoDroidlayer which depicts the position of Esya.ru channels objects - * - * @author Denis Fokin - * @see OsMoDroidPlugin - * - */ -public class OsMoDroidLayer extends OsmandMapLayer implements ContextMenuLayer.IContextMenuProvider { - /** - * magic number so far - */ - private static final int radius = 10; - OsMoDroidPoint seekOsMoDroidPoint; - OsMoDroidPlugin myOsMoDroidPlugin; - - private DisplayMetrics dm; - - private final MapActivity map; - private OsmandMapTileView view; - - private Paint textPaint; - - ArrayList osMoDroidPointArrayList; - ArrayList osMoDroidFixedPointArrayList; - ArrayList gpxArrayList = new ArrayList() ; - int layerId; - String layerName; - String layerDescription; - private Paint paint; - - private Path path; - - private OsmandSettings settings; - - private RenderingRulesStorage cachedRrs; - private boolean cachedNightMode; - private int cachedColor; - - - private void initUI() { - paint = new Paint(); - paint.setStyle(Style.STROKE); - paint.setStrokeWidth(14); - paint.setAntiAlias(true); - paint.setStrokeCap(Cap.ROUND); - paint.setStrokeJoin(Join.ROUND); - - path = new Path(); - } - private Bitmap opIcon; - - public void refresh() { - map.refreshMap(); - } - - public OsMoDroidLayer(MapActivity map) { - this.map = map; - } - - public OsMoDroidLayer(MapActivity map, int layerId, OsMoDroidPlugin osMoDroidPlugin, String layerName, String layerDescription) { - this.map = map; - this.layerId = layerId; - this.myOsMoDroidPlugin = osMoDroidPlugin; - this.layerName = layerName; - this.layerDescription = layerDescription; - - - } - - @Override - public void initLayer(OsmandMapTileView view) { - this.view = view; - dm = new DisplayMetrics(); - WindowManager wmgr = (WindowManager) view.getContext().getSystemService(Context.WINDOW_SERVICE); - wmgr.getDefaultDisplay().getMetrics(dm); - textPaint = new Paint(); - textPaint.setDither(true); - textPaint.setAntiAlias(true); - textPaint.setFilterBitmap(true); - - textPaint.setTextSize(22f); - textPaint.setTypeface(Typeface.DEFAULT_BOLD); - textPaint.setTextAlign(Paint.Align.CENTER); - opIcon = BitmapFactory.decodeResource(view.getResources(), R.drawable.bicycle_location); - osMoDroidPointArrayList = myOsMoDroidPlugin.getOsMoDroidPointArrayList(layerId); - osMoDroidFixedPointArrayList = myOsMoDroidPlugin.getOsMoDroidFixedPointArrayList(layerId); - initUI(); - } - - public void inGPXFilelist(ArrayList in){ - gpxArrayList=in; - map.refreshMap(); - } - - @Override - public void onPrepareBufferImage(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) { - - for (ColoredGPX cg : gpxArrayList){ - List> points = cg.gpxFile.proccessPoints(); - - paint.setColor(cg.color); - - final QuadRect latLonBounds = tileBox.getLatLonBounds(); - for (List l : points) { - path.rewind(); - int startIndex = -1; - - for (int i = 0; i < l.size(); i++) { - WptPt ls = l.get(i); - if (startIndex == -1) { - if (ls.lat >= latLonBounds.bottom - 0.1 && ls.lat <= latLonBounds.top + 0.1 && ls.lon >= latLonBounds.left - 0.1 - && ls.lon <= latLonBounds.right + 0.1) { - startIndex = i > 0 ? i - 1 : i; - } - } else if (!(latLonBounds.left <= ls.lon + 0.1 && ls.lon - 0.1 <= latLonBounds.right - && latLonBounds.bottom <= ls.lat + 0.1 && ls.lat - 0.1 <= latLonBounds.top)) { - drawSegment(canvas, tileBox, l, startIndex, i); - startIndex = -1; - } - } - if (startIndex != -1) { - drawSegment(canvas, tileBox, l, startIndex, l.size() - 1); - continue; - } - } - } - - for (OsMoDroidPoint op : osMoDroidPointArrayList) { - if(seekOsMoDroidPoint!=null&&seekOsMoDroidPoint.equals(op)){ - map.setMapLocation(op.latlon.getLatitude(), op.latlon.getLongitude()); - } - LatLon newLatlon; - try { - - newLatlon = new LatLon(myOsMoDroidPlugin.mIRemoteService.getObjectLat(layerId, op.id), - myOsMoDroidPlugin.mIRemoteService.getObjectLon(layerId, op.id)); - - if (!op.latlon.equals(newLatlon)) { - op.prevlatlon = op.latlon; - } - op.latlon = newLatlon; - op.speed = myOsMoDroidPlugin.mIRemoteService.getObjectSpeed(layerId, op.id); - } catch (RemoteException e) { - // TODO Auto-generated catch block - e.printStackTrace(); - return; - } - - double latitude = op.latlon.getLatitude(); - double longitude = op.latlon.getLongitude(); - double prevlatitude = op.latlon.getLatitude(); - double prevlongitude = op.latlon.getLongitude(); - if (op.prevlatlon != null) { - prevlatitude = op.prevlatlon.getLatitude(); - prevlongitude = op.prevlatlon.getLongitude(); - } - - int locationX = (int) tileBox.getPixXFromLatLon(latitude, longitude); - int locationY = (int) tileBox.getPixYFromLatLon(latitude, longitude); - int prevlocationX = (int) tileBox.getPixXFromLatLon(prevlatitude, prevlongitude); - int prevlocationY = (int) tileBox.getPixYFromLatLon(prevlatitude, prevlongitude); - - // int y = opIcon.getHeight()/2; - // int x = opIcon.getWidth()/2; - textPaint.setColor(Color.parseColor("#013220")); - canvas.drawText(op.name, locationX, locationY - radius, textPaint); - canvas.drawText(op.speed, locationX, locationY - 2 * radius, textPaint); - textPaint.setColor(Color.parseColor("#" + op.color)); - textPaint.setShadowLayer(radius, 0, 0, Color.GRAY); - canvas.drawCircle(locationX, locationY, radius, textPaint); - // canvas.drawBitmap(opIcon, locationX-x, locationY-y , textPaint); - textPaint.setStrokeWidth(radius); - canvas.drawLine(locationX, locationY, prevlocationX, prevlocationY, textPaint); - // canvas.rotate(-view.getRotate(), locationX, locationY); - // op.prevlatlon=op.latlon; - - } - - for (OsMoDroidPoint point : osMoDroidFixedPointArrayList ){ - double latitude = point.latlon.getLatitude(); - double longitude = point.latlon.getLongitude(); - int locationX = (int) tileBox.getPixXFromLatLon(latitude, longitude); - int locationY = (int) tileBox.getPixYFromLatLon(latitude, longitude); - textPaint.setColor(Color.parseColor("#013220")); - canvas.drawText(point.name, locationX, locationY - radius, textPaint); - textPaint.setColor(Color.parseColor("#" + point.color)); - textPaint.setShadowLayer(radius, 0, 0, Color.GRAY); - canvas.drawRect(new Rect(locationX-radius, locationY-radius, locationX+radius, locationY+radius), textPaint); - } - - - - } - private void drawSegment(Canvas canvas, RotatedTileBox tb, List l, int startIndex, int endIndex) { - int px = (int) tb.getPixXFromLatLon(l.get(startIndex).lat, l.get(startIndex).lon); - int py = (int) tb.getPixYFromLatLon(l.get(startIndex).lat, l.get(startIndex).lon); - path.moveTo(px, py); - for (int i = startIndex + 1; i <= endIndex; i++) { - WptPt p = l.get(i); - int x = (int) tb.getPixXFromLatLon(p.lat,p.lon); - int y = (int) tb.getPixYFromLatLon(p.lat,p.lon); - path.lineTo(x, y); - } - canvas.drawPath(path, paint); - } - - @Override - public void onDraw(Canvas canvas, RotatedTileBox tileBox, DrawSettings settings) {} - - public void getOsMoDroidPointFromPoint(RotatedTileBox tb,PointF point, List om) { - if (osMoDroidPointArrayList != null) { - int ex = (int) point.x; - int ey = (int) point.y; - - try { - for (int i = 0; i < osMoDroidPointArrayList.size(); i++) { - OsMoDroidPoint n = osMoDroidPointArrayList.get(i); - if (!om.contains(n)) { - int x = (int) tb.getPixXFromLatLon(n.latlon.getLatitude(), n.latlon.getLongitude()); - int y = (int) tb.getPixYFromLatLon(n.latlon.getLatitude(), n.latlon.getLongitude()); - if (Math.abs(x - ex) <= opIcon.getWidth() && Math.abs(y - ey) <= opIcon.getHeight()) { - om.add(n); - } - } - } - } catch (IndexOutOfBoundsException e) { - // that's really rare case, but is much efficient than introduce - // synchronized block - } - } - if (osMoDroidFixedPointArrayList != null) { - int ex = (int) point.x; - int ey = (int) point.y; - - try { - for (int i = 0; i om = new ArrayList(); - getOsMoDroidPointFromPoint(tileBox, point, om); - if (!om.isEmpty()) { - StringBuilder res = new StringBuilder(); - for (int i = 0; i < om.size(); i++) { - OsMoDroidPoint n = om.get(i); - if (i > 0) { - res.append("\n\n"); - } - res = res.append(n.description); - } - AccessibleToast.makeText(view.getContext(), res.toString(), Toast.LENGTH_SHORT).show(); - return true; - } - return false; - } - - @Override - public void destroyLayer() { - - } - - @Override - public boolean drawInScreenPixels() { - return true; - } - - @Override - public String getObjectName(Object o) { - if (o instanceof OsMoDroidPoint) { - return ((OsMoDroidPoint) o).name; - } - return null; - } - - @Override - public void collectObjectsFromPoint(PointF point, RotatedTileBox tileBox, List o) { - getOsMoDroidPointFromPoint(tileBox, point, o); - - } - - @Override - public LatLon getObjectLocation(Object o) { - if (o instanceof OsMoDroidPoint) { - return ((OsMoDroidPoint) o).latlon; - } - return null; - } - - @Override - public String getObjectDescription(Object o) { - if (o instanceof OsMoDroidPoint) { - return ((OsMoDroidPoint) o).description; - } - return null; - } - -} \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPlugin.java b/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPlugin.java deleted file mode 100644 index 97b3a0f365..0000000000 --- a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPlugin.java +++ /dev/null @@ -1,350 +0,0 @@ -package net.osmand.plus.osmodroid; - -import java.io.File; -import java.util.ArrayList; -import java.util.ConcurrentModificationException; - -import net.osmand.PlatformUtil; -import net.osmand.data.LatLon; -import net.osmand.plus.ContextMenuAdapter; -import net.osmand.plus.ContextMenuAdapter.OnContextMenuClick; -import net.osmand.plus.GPXUtilities; -import net.osmand.plus.OsmandApplication; -import net.osmand.plus.OsmandPlugin; -import net.osmand.plus.R; -import net.osmand.plus.TargetPointsHelper; -import net.osmand.plus.activities.MapActivity; -import net.osmand.plus.base.FailSafeFuntions; -import net.osmand.plus.views.MonitoringInfoControl; -import net.osmand.plus.views.MonitoringInfoControl.MonitoringInfoControlServices; -import net.osmand.plus.views.OsmandMapTileView; - -import org.apache.commons.logging.Log; - -import android.content.ComponentName; -import android.content.Context; -import android.content.DialogInterface; -import android.content.Intent; -import android.content.ServiceConnection; -import android.os.AsyncTask; -import android.os.IBinder; -import android.os.RemoteException; - -import com.OsMoDroid.IRemoteOsMoDroidListener; -import com.OsMoDroid.IRemoteOsMoDroidService; - -public class OsMoDroidPlugin extends OsmandPlugin implements MonitoringInfoControlServices { - IRemoteOsMoDroidListener.Stub inter = new IRemoteOsMoDroidListener.Stub() { - - @Override - public void channelUpdated() throws RemoteException { - if (activity != null) { - activity.refreshMap(); - // test - } - } - - @Override - public void channelsListUpdated() throws RemoteException { - if (activity != null && connected) { - log.debug("update channels"); - for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) { - activity.getMapView().removeLayer(myOsMoDroidLayer); - } - osmoDroidLayerList.clear(); - requestLayersFromOsMoDroid(activity); - for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) { - activity.getMapView().addLayer(myOsMoDroidLayer, 4.5f); - - } - activity.refreshMap(); - } - - } - - public void reRouteTo(LatLon loc) { - final OsmandApplication app = activity.getMyApplication(); - final TargetPointsHelper targets = app.getTargetPointsHelper(); - // If we are in following mode then just update target point - targets.navigateToPoint(loc, true, -1); - if(!app.getRoutingHelper().isFollowingMode()) { - // If we are not in following mode then request new route to calculate - // Use default application mode - activity.runOnUiThread(new Runnable() { - - @Override - public void run() { - FailSafeFuntions.enterRoutingMode(activity, null); - } - }); - - } - } - - @Override - public void routeTo(float Lat, float Lon) throws RemoteException { - reRouteTo(new LatLon(Lat, Lon)); - - } - - }; - - @Override - public void updateLayers(OsmandMapTileView mapView, MapActivity activity) { - registerLayers(activity); - super.updateLayers(mapView, activity); - MonitoringInfoControl lock = activity.getMapLayers().getMapInfoLayer().getMonitoringInfoControl(); - if(lock != null && !lock.getMonitorActions().contains(this)) { - lock.addMonitorActions(this); - } - } - - MapActivity activity; - public static final String ID = "osmand.osmodroid"; - private static final Log log = PlatformUtil.getLog(OsMoDroidPlugin.class); - private OsmandApplication app; - IRemoteOsMoDroidService mIRemoteService; - private ServiceConnection mConnection; - private int OSMODROID_SUPPORTED_VERSION_MIN = 5; - private OsMoDroidLayer osmoDroidLayer; - protected boolean connected = false; - ArrayList osmoDroidLayerList = new ArrayList(); - private AsyncTask task; - - public ArrayList getOsMoDroidPointArrayList(int id) { - ArrayList result = new ArrayList(); - try { - for (int i = 0; i < mIRemoteService.getNumberOfObjects(id); i++) { - result.add(new OsMoDroidPoint(mIRemoteService.getObjectLat(id, mIRemoteService.getObjectId(id, i)), mIRemoteService - .getObjectLon(id, mIRemoteService.getObjectId(id, i)), mIRemoteService.getObjectName(id, - mIRemoteService.getObjectId(id, i)), mIRemoteService.getObjectDescription(id, mIRemoteService.getObjectId(id, i)), - mIRemoteService.getObjectId(id, i), id, mIRemoteService.getObjectSpeed(id, mIRemoteService.getObjectId(id, i)), - mIRemoteService.getObjectColor(id, mIRemoteService.getObjectId(id, i)))); - } - } catch (RemoteException e) { - - log.error(e.getMessage(), e); - } - - return result; - - } - - public ArrayList getOsMoDroidFixedPointArrayList(int id) { - ArrayList result = new ArrayList(); - try { - for (int i = 0; i < mIRemoteService.getNumberOfPoints(id); i++) { - result.add(new OsMoDroidPoint(mIRemoteService.getPointLat(id, mIRemoteService.getPointId(id, i)), mIRemoteService - .getPointLon(id, mIRemoteService.getPointId(id, i)), mIRemoteService.getPointName(id, - mIRemoteService.getPointId(id, i)), mIRemoteService.getPointDescription(id, mIRemoteService.getPointId(id, i)), - mIRemoteService.getPointId(id, i), id, null, - mIRemoteService.getPointColor(id, mIRemoteService.getPointId(id, i)))); - } - } catch (RemoteException e) { - - log.error(e.getMessage(), e); - } - - return result; - - } - - @Override - public String getId() { - return ID; - } - - public OsMoDroidPlugin(OsmandApplication app) { - this.app = app; - - } - - @Override - public String getDescription() { - return app.getString(R.string.osmodroid_plugin_description) + "\n External application."; - } - - @Override - public String getName() { - return app.getString(R.string.osmodroid_plugin_name) + " (external)"; - } - - // test - @Override - public boolean init(final OsmandApplication app) { - mConnection = new ServiceConnection() { - @Override - public void onServiceConnected(ComponentName name, IBinder service) { - mIRemoteService = IRemoteOsMoDroidService.Stub.asInterface(service); - try { - System.out.println(mIRemoteService.getVersion()); - if (mIRemoteService.getVersion() < OSMODROID_SUPPORTED_VERSION_MIN) { - app.showToastMessage(R.string.osmodroid_plugin_old_ver_not_supported); - shutdown(app); - } else { - mIRemoteService.registerListener(inter); - connected = true; - } - - } catch (RemoteException e) { - log.error(e.getMessage(), e); - } - - } - - @Override - public void onServiceDisconnected(ComponentName name) { - connected = false; - mIRemoteService = null; - } - }; - Intent serviceIntent = (new Intent("OsMoDroid.remote")); - app.bindService(serviceIntent, mConnection, Context.BIND_AUTO_CREATE); - return true; - } - - void requestLayersFromOsMoDroid(MapActivity activity) { - try { - for (int i = 0; i < mIRemoteService.getNumberOfLayers(); i++) { - osmoDroidLayerList.add(new OsMoDroidLayer(activity, mIRemoteService.getLayerId(i), this, mIRemoteService - .getLayerName(mIRemoteService.getLayerId(i)), mIRemoteService.getLayerDescription(mIRemoteService.getLayerId(i)))); - } - } catch (RemoteException e) { - - log.error(e.getMessage(), e); - } - getGpxArrayList(); - } - - @Override - public void registerLayers(MapActivity activity) { - this.activity = activity; - if (connected) { - - for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) { - activity.getMapView().removeLayer(myOsMoDroidLayer); - } - osmoDroidLayerList.clear(); - requestLayersFromOsMoDroid(activity); - for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) { - activity.getMapView().addLayer(myOsMoDroidLayer, 4.5f); - - } - } - - } - - @Override - public void registerLayerContextMenuActions(OsmandMapTileView mapView, ContextMenuAdapter adapter, MapActivity mapActivity) { - for (OsMoDroidLayer myOsMoDroidLayer : osmoDroidLayerList) { - adapter.item(myOsMoDroidLayer.layerName).reg(); - } - - super.registerLayerContextMenuActions(mapView, adapter, mapActivity); - } - - @Override - public void disable(OsmandApplication app) { - shutdown(app); - } - - private void shutdown(OsmandApplication app) { - if (mIRemoteService != null) { - if (connected) { - try { - mIRemoteService.unregisterListener(inter); - } catch (RemoteException e) { - log.error(e.getMessage(), e); - } - } - app.unbindService(mConnection); - mIRemoteService = null; - } - } - - - @Override - public void addMonitorActions(final ContextMenuAdapter qa, final MonitoringInfoControl li, final OsmandMapTileView view) { - boolean o = true; - try { - o = mIRemoteService.isActive(); - } - catch(Exception e) { - log.error(e.getMessage(), e); - - } - final boolean off = !o; - qa.item(off ? R.string.osmodroid_mode_off : R.string.osmodroid_mode_on - ).icon( off ? R.drawable.monitoring_rec_inactive : R.drawable.monitoring_rec_big).listen(new OnContextMenuClick() { - - @Override - public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { - try { - if (off) { - mIRemoteService.Activate(); - } else { - mIRemoteService.Deactivate(); - } - } catch(Exception e) { - log.error(e.getMessage(), e); - } - } - }).reg(); - qa.item(R.string.osmodroid_refresh).icons(R.drawable.ic_action_grefresh_dark, R.drawable.ic_action_grefresh_light).listen(new OnContextMenuClick() { - - @Override - public void onContextMenuClick(int itemId, int pos, boolean isChecked, - DialogInterface dialog) { - try { - mIRemoteService.refreshChannels(); - } catch (RemoteException e) { - log.error(e.getMessage(), e); - } - - } - }).reg(); -qa.item(R.string.osmodroid_unseek).icons(R.drawable.abs__ic_commit_search_api_holo_dark, R.drawable.abs__ic_commit_search_api_holo_light).listen(new OnContextMenuClick() { - - @Override - public void onContextMenuClick(int itemId, int pos, boolean isChecked, - DialogInterface dialog) { - for (OsMoDroidLayer l: osmoDroidLayerList){ - l.seekOsMoDroidPoint=null; - } - - } - }).reg(); - } - - public void getGpxArrayList() { - if(task!=null){ - task.cancel(true); - } - task = new AsyncTask() { - @Override - protected Void doInBackground(Void... params) { - for (OsMoDroidLayer l : osmoDroidLayerList){ - ArrayList temp = new ArrayList(); - try { - for (int i = 0; i < mIRemoteService.getNumberOfGpx(l.layerId); i++) { - ColoredGPX cg = new ColoredGPX(); - cg.gpxFile = GPXUtilities.loadGPXFile(app, new File(mIRemoteService.getGpxFile(l.layerId, i))); - cg.color = mIRemoteService.getGpxColor(l.layerId, i); - temp.add(cg); - } - l.inGPXFilelist(temp); - } catch (RemoteException e) { - log.error(e.getMessage(), e); - } - catch (ConcurrentModificationException e) { - log.error(e.getMessage(), e); - } - - } - return null; - - } - }; - task.execute(); - } -} diff --git a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPoint.java b/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPoint.java deleted file mode 100644 index a724e07f79..0000000000 --- a/OsmAnd/src/net/osmand/plus/osmodroid/OsMoDroidPoint.java +++ /dev/null @@ -1,40 +0,0 @@ -package net.osmand.plus.osmodroid; - -import net.osmand.data.LatLon; - -public class OsMoDroidPoint { - @Override - public boolean equals(Object o) { - - if ((o instanceof OsMoDroidPoint) && this.id == ((OsMoDroidPoint) o).id) { - return true; - } else { - return false; - } - } - - LatLon latlon; - LatLon prevlatlon; - String name; - String description; - int id; - int layerId; - String speed = ""; - String color = "AAAAAA"; - - public OsMoDroidPoint(float objectLat, float objectLon, String objectName, String objectDescription, int objectId, - int layerId, String speed, String color) { - this.latlon = new LatLon(objectLat, objectLon); - this.name = objectName; - this.description = objectDescription; - this.id = objectId; - this.layerId = layerId; - if (speed != null) { - this.speed = speed; - } - if (color != null) { - this.color = color; - } - } - -} diff --git a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java index acb2cee59b..f29e6ed184 100644 --- a/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java +++ b/OsmAnd/src/net/osmand/plus/render/MapRenderRepositories.java @@ -676,7 +676,13 @@ public class MapRenderRepositories { currentRenderingContext.nightMode = nightMode; currentRenderingContext.preferredLocale = prefs.MAP_PREFERRED_LOCALE.get(); currentRenderingContext.setDensityValue(mapDensity); - currentRenderingContext.screenDensityRatio = mapDensity / Math.max(1, requestedBox.getDensity()) ; + //Text/icon scales according to mapDensity (so text is size of road) +// currentRenderingContext.textScale = (requestedBox.getDensity()*app.getSettings().TEXT_SCALE.get()); + //Text/icon stays same for all sizes + currentRenderingContext.textScale = (requestedBox.getDensity() * app.getSettings().TEXT_SCALE.get()) + / mapDensity; + + currentRenderingContext.screenDensityRatio = 1 / Math.max(1, requestedBox.getDensity()) ; // init rendering context currentRenderingContext.tileDivisor = tileDivisor; if (checkWhetherInterrupted()) { diff --git a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java index 45506c1f40..f1be27d047 100644 --- a/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/OsmandRenderer.java @@ -320,6 +320,7 @@ public class OsmandRenderer { int visbleWidth = icon.iconSize >= 0 ? (int) icon.iconSize : ico.getWidth(); int visbleHeight = icon.iconSize >= 0 ? (int) icon.iconSize : ico.getHeight(); boolean intersects = false; + float coeff = rc.getDensityValue(rc.screenDensityRatio * rc.textScale); RectF rf = calculateRect(rc, icon, ico.getWidth(), ico.getHeight()); RectF visibleRect = null; if (visbleHeight > 0 && visbleWidth > 0) { @@ -337,14 +338,14 @@ public class OsmandRenderer { Bitmap shield = icon.shieldId == null ? null : RenderingIcons.getIcon(context, icon.shieldId); if(shield != null) { RectF shieldRf = calculateRect(rc, icon, shield.getWidth(), shield.getHeight()); - if (rc.screenDensityRatio != 1f) { + if (coeff != 1f) { Rect src = new Rect(0, 0, shield.getWidth(), shield.getHeight()); cv.drawBitmap(shield, src, shieldRf, paintIcon); } else { cv.drawBitmap(shield, shieldRf.left, shieldRf.top, paintIcon); } } - if (rc.screenDensityRatio != 1f) { + if (coeff != 1f) { Rect src = new Rect(0, 0, ico.getWidth(), ico.getHeight()); cv.drawBitmap(ico, src, rf, paintIcon); } else { @@ -367,10 +368,11 @@ public class OsmandRenderer { private RectF calculateRect(RenderingContext rc, IconDrawInfo icon, int visbleWidth, int visbleHeight) { RectF rf; - float left = icon.x - visbleWidth / 2 * rc.screenDensityRatio; - float top = icon.y - visbleHeight / 2 * rc.screenDensityRatio; - float right = left + visbleWidth * rc.screenDensityRatio; - float bottom = top + visbleHeight * rc.screenDensityRatio; + float coeff = rc.getDensityValue(rc.screenDensityRatio * rc.textScale); + float left = icon.x - visbleWidth / 2 * coeff; + float top = icon.y - visbleHeight / 2 * coeff; + float right = left + visbleWidth * coeff; + float bottom = top + visbleHeight * coeff; rf = new RectF(left, top, right, bottom); return rf; } diff --git a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java index 8d69d77578..81da950309 100644 --- a/OsmAnd/src/net/osmand/plus/render/TextRenderer.java +++ b/OsmAnd/src/net/osmand/plus/render/TextRenderer.java @@ -69,7 +69,7 @@ public class TextRenderer { if (textColor == 0) { textColor = Color.BLACK; } - textSize = rc.getComplexValue(render, render.ALL.R_TEXT_SIZE); + textSize = rc.getComplexValue(render, render.ALL.R_TEXT_SIZE) ; textShadow = (int) rc.getComplexValue(render, render.ALL.R_TEXT_HALO_RADIUS); textShadowColor = render.getIntPropertyValue(render.ALL.R_TEXT_HALO_COLOR); if(textShadowColor == 0) { @@ -226,7 +226,7 @@ public class TextRenderer { } // sest text size before finding intersection (it is used there) - float textSize = text.textSize; + float textSize = text.textSize * rc.textScale ; paintText.setTextSize(textSize); paintText.setFakeBoldText(text.bold); paintText.setColor(text.textColor); @@ -250,15 +250,14 @@ public class TextRenderer { cv.drawTextOnPath(text.text, text.drawOnPath, 0, text.vOffset, paintText); } else { if (text.shieldRes != null) { + float coef = rc.getDensityValue(rc.screenDensityRatio * rc.textScale); Bitmap ico = RenderingIcons.getIcon(context, text.shieldRes); if (ico != null) { - float left = text.centerX - ico.getWidth() / 2 * rc.screenDensityRatio - - 0.5f; - float top = text.centerY - ico.getHeight() / 2 * rc.screenDensityRatio - - rc.getDensityValue(4.5f); + float left = text.centerX - ico.getWidth() / 2 * coef - 0.5f; + float top = text.centerY - ico.getHeight() / 2 * coef - paintText.descent() - 0.5f; if(rc.screenDensityRatio != 1f){ - RectF rf = new RectF(left, top, left + ico.getWidth() * rc.screenDensityRatio , - top + ico.getHeight() * rc.screenDensityRatio); + RectF rf = new RectF(left, top, left + ico.getWidth() * coef, + top + ico.getHeight() * coef); Rect src = new Rect(0, 0, ico.getWidth(), ico .getHeight()); cv.drawBitmap(ico, src, rf, paintIcon); diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java index 32b2837c2f..5dcdf86d6a 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyCustomization.java @@ -229,7 +229,7 @@ public class SherpafyCustomization extends OsmAndAppCustomization { } this.tourPresent = tourPresent; if(!suggestToDownloadMap.isEmpty()) { - final DownloadIndexFragment da = app.getDownloadActivity(); + final DownloadActivity da = app.getDownloadActivity(); if (da != null) { app.runInUIThread(new Runnable() { @@ -552,26 +552,36 @@ public class SherpafyCustomization extends OsmAndAppCustomization { @Override public void prepareOptionsMenu(final MapActivity mapActivity, ContextMenuAdapter adapter) { - filter(adapter, R.string.menu_layers, - R.string.pause_navigation, R.string.continue_navigation, + filter(adapter,R.string.pause_navigation, R.string.continue_navigation, R.string.cancel_navigation, R.string.cancel_route, R.string.clear_destination, R.string.target_points, R.string.get_directions, R.string.menu_mute_on, R.string.menu_mute_off, R.string.where_am_i, R.string.context_menu_item_share_location); - final StageInformation stage = getSelectedStage(); - if (stage != null && !isStageVisited(stage.order)) { - adapter.item(R.string.complete_stage) - .icons(R.drawable.ic_action_finish_flag_dark, R.drawable.ic_action_finish_flag_light) - .position(adapter.length() - 1).listen(new OnContextMenuClick() { + //poi + if (osmandSettings.SHOW_POI_OVER_MAP.get()) { + adapter.item(R.string.sherpafy_disable_poi).icons( + R.drawable.ic_action_gremove_dark, R.drawable.ic_action_gremove_light) + .listen(new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + app.getSettings().SHOW_POI_OVER_MAP.set(false); + mapActivity.getMapLayers().updateLayers(mapActivity.getMapView()); + } + }).reg(); + } else { + adapter.item(R.string.poi).icons(R.drawable.ic_action_layers_dark, R.drawable.ic_action_layers_light) + .listen(new OnContextMenuClick() { @Override public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { - markStageAsCompleted(stage); - showCompleteStageFragment(mapActivity, stage, false); + mapActivity.getMapLayers().selectPOIFilterLayer(mapActivity.getMapView(), null); + app.getSettings().SHOW_POI_OVER_MAP.set(true); + mapActivity.getMapLayers().updateLayers(mapActivity.getMapView()); } }).reg(); } - adapter.item(R.string.sherpafy_tour_info_txt).icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light).position(adapter.length() - 1) + //important info + adapter.item(R.string.sherpafy_tour_info_txt).icons(R.drawable.ic_action_info_dark, R.drawable.ic_action_info_light) .listen(new OnContextMenuClick() { @Override public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { @@ -580,7 +590,19 @@ public class SherpafyCustomization extends OsmAndAppCustomization { mapActivity.startActivity(newIntent); } }).reg(); - + //complete stage + final StageInformation stage = getSelectedStage(); + if (stage != null && !isStageVisited(stage.order)) { + adapter.item(R.string.complete_stage) + .icons(R.drawable.ic_action_finish_flag_dark, R.drawable.ic_action_finish_flag_light) + .listen(new OnContextMenuClick() { + @Override + public void onContextMenuClick(int itemId, int pos, boolean isChecked, DialogInterface dialog) { + markStageAsCompleted(stage); + showCompleteStageFragment(mapActivity, stage, false); + } + }).reg(); + } //share my location adapter.item(R.string.context_menu_item_share_location).icons( R.drawable.ic_action_gshare_dark, R.drawable.ic_action_gshare_light).listen(new OnContextMenuClick() { @@ -593,7 +615,6 @@ public class SherpafyCustomization extends OsmAndAppCustomization { } } }).reg(); - } diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoriteFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoriteFragment.java index 77977d6c3e..b6d922414b 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoriteFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoriteFragment.java @@ -37,9 +37,9 @@ public class SherpafyFavoriteFragment extends SherpafyStageInfoFragment { int k = args.getInt(FAV_PARAM); if (stage != null) { fav = (StageFavorite) stage.getFavorites().get(k); - if (getSherlockActivity().getSupportActionBar() != null) { - getSherlockActivity().getSupportActionBar().setTitle(fav.getName()); - } +// if (getSherlockActivity().getSupportActionBar() != null) { +// getSherlockActivity().getSupportActionBar().setTitle(fav.getName()); +// } } } diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoritesListFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoritesListFragment.java index 0538b51c8d..6d28a1d688 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoritesListFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyFavoritesListFragment.java @@ -59,9 +59,9 @@ public class SherpafyFavoritesListFragment extends SherlockListFragment { @Override public void onResume() { super.onResume(); - if(tour != null) { - getSherlockActivity().getSupportActionBar().setTitle(tour.getName()); - } +// if(tour != null) { +// getSherlockActivity().getSupportActionBar().setTitle(tour.getName()); +// } } @Override diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java index 3c1f7c23fa..bfba6c89f2 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageFragment.java @@ -62,7 +62,9 @@ public class SherpafyStageFragment extends SherlockFragment { if(tour != null && tour.getStageInformation().size() > k) { stage = tour.getStageInformation().get(k); } - getSherlockActivity().getSupportActionBar().setTitle(getString(R.string.tab_stage) + " " + (k+1)); + if (stage != null){ + getSherlockActivity().getSupportActionBar().setTitle(stage.getName()); + } } diff --git a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageInfoFragment.java b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageInfoFragment.java index 2d5155c5fa..1b3b12a561 100644 --- a/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageInfoFragment.java +++ b/OsmAnd/src/net/osmand/plus/sherpafy/SherpafyStageInfoFragment.java @@ -75,6 +75,9 @@ public class SherpafyStageInfoFragment extends SherlockFragment { protected void updateView(WebView description, ImageView icon, TextView additional, TextView text, TextView header) { + if (stage == null){ + return; + } if (stage.getImageBitmap() != null) { icon.setImageBitmap(stage.getImageBitmap()); } else { diff --git a/OsmAnd/src/net/osmand/plus/views/AnimateDraggingMapThread.java b/OsmAnd/src/net/osmand/plus/views/AnimateDraggingMapThread.java index 4cd8b1fbbb..17cc681a2d 100644 --- a/OsmAnd/src/net/osmand/plus/views/AnimateDraggingMapThread.java +++ b/OsmAnd/src/net/osmand/plus/views/AnimateDraggingMapThread.java @@ -35,6 +35,8 @@ public class AnimateDraggingMapThread { private double targetLongitude = 0; private int targetIntZoom = 0; private float targetZoomScale = 0; + + private boolean isAnimatingZoom; public AnimateDraggingMapThread(OsmandMapTileView tileView){ @@ -207,29 +209,38 @@ public class AnimateDraggingMapThread { } private void animatingZoomInThread(float zoomStart, int zoom, float zoomScale, float animationTime, boolean notifyListener){ - float curZoom = zoomStart; - float zoomEnd = zoom + zoomScale; - animationTime *= Math.abs(zoomEnd - zoomStart); - // AccelerateInterpolator interpolator = new AccelerateInterpolator(1); - LinearInterpolator interpolator = new LinearInterpolator(); - - long timeMillis = SystemClock.uptimeMillis(); - float normalizedTime = 0f; - while(!stopped){ - normalizedTime = (SystemClock.uptimeMillis() - timeMillis) / animationTime; - if(normalizedTime > 1f){ - break; - } - float interpolation = interpolator.getInterpolation(normalizedTime); - curZoom = interpolation * (zoomEnd - zoomStart) + zoomStart; - tileView.zoomToAnimate(curZoom, notifyListener); - try { - Thread.sleep(DEFAULT_SLEEP_TO_REDRAW); - } catch (InterruptedException e) { - stopped = true; + try { + isAnimatingZoom = true; + float curZoom = zoomStart; + float zoomEnd = zoom + zoomScale; + animationTime *= Math.abs(zoomEnd - zoomStart); + // AccelerateInterpolator interpolator = new AccelerateInterpolator(1); + LinearInterpolator interpolator = new LinearInterpolator(); + + long timeMillis = SystemClock.uptimeMillis(); + float normalizedTime = 0f; + while (!stopped) { + normalizedTime = (SystemClock.uptimeMillis() - timeMillis) / animationTime; + if (normalizedTime > 1f) { + break; + } + float interpolation = interpolator.getInterpolation(normalizedTime); + curZoom = interpolation * (zoomEnd - zoomStart) + zoomStart; + tileView.zoomToAnimate(curZoom, notifyListener); + try { + Thread.sleep(DEFAULT_SLEEP_TO_REDRAW); + } catch (InterruptedException e) { + stopped = true; + } } + tileView.setZoomAnimate(zoom, zoomScale, notifyListener); + } finally { + isAnimatingZoom = false; } - tileView.setZoomAnimate(zoom, zoomScale, notifyListener); + } + + public boolean isAnimatingZoom() { + return isAnimatingZoom; } public void startZooming(final int zoomEnd, final boolean notifyListener){ diff --git a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java index 0f3178c4c6..452c124d89 100644 --- a/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java +++ b/OsmAnd/src/net/osmand/plus/views/MultiTouchSupport.java @@ -131,4 +131,8 @@ public class MultiTouchSupport { return false; } + + public PointF getCenterPoint() { + return centerPoint; + } } diff --git a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java index fff6cbba97..e34d874f3d 100644 --- a/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java +++ b/OsmAnd/src/net/osmand/plus/views/OsmandMapTileView.java @@ -362,7 +362,7 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall } public float getSettingsZoomScale() { - return getSettings().getSettingsZoomScale(getDensity()); + return getSettings().getSettingsZoomScale() + (float)Math.sqrt(Math.max(0, getDensity() - 1)); } public float getZoomScale() { @@ -549,12 +549,18 @@ public class OsmandMapTileView extends SurfaceView implements IMapDownloaderCall // skip it } } - if (showMapPosition) { - canvas.drawCircle(c.x, c.y, 3 * dm.density, paintCenter); - canvas.drawCircle(c.x, c.y, 7 * dm.density, paintCenter); + if (showMapPosition || animatedDraggingThread.isAnimatingZoom()) { + drawMapPosition(canvas, c.x, c.y); + } else if(multiTouchSupport.isInZoomMode()) { + drawMapPosition(canvas, multiTouchSupport.getCenterPoint().x, multiTouchSupport.getCenterPoint().y); } } + protected void drawMapPosition(Canvas canvas, float x, float y) { + canvas.drawCircle(x, y, 3 * dm.density, paintCenter); + canvas.drawCircle(x, y, 7 * dm.density, paintCenter); + } + private void refreshBufferImage(final DrawSettings drawSettings) { if (!baseHandler.hasMessages(BASE_REFRESH_MESSAGE) || drawSettings.isUpdateVectorRendering()) { Message msg = Message.obtain(baseHandler, new Runnable() { diff --git a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java index 33375cb59f..3d8654a94f 100644 --- a/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java +++ b/OsmAnd/src/net/osmand/plus/views/POIMapLayer.java @@ -58,8 +58,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon /// cache for displayed POI // Work with cache (for map copied from AmenityIndexRepositoryOdb) private MapLayerData> data; - private boolean path = false; - private double radius = 100; public POIMapLayer(final MapActivity activity) { @@ -83,10 +81,10 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon @Override protected List calculateResult(RotatedTileBox tileBox) { QuadRect latLonBounds = tileBox.getLatLonBounds(); - if(path) { - RouteCalculationResult result = routingHelper.getRoute(); - return resourceManager.searchAmenitiesOnThePath(result.getImmutableAllLocations(), radius, filter, null); - } else { +// if(path) { +// RouteCalculationResult result = routingHelper.getRoute(); +// return resourceManager.searchAmenitiesOnThePath(result.getImmutableAllLocations(), radius, filter, null); +// } else { return resourceManager.searchAmenities(filter, latLonBounds.top, latLonBounds.left, latLonBounds.bottom, latLonBounds.right, tileBox.getZoom(), new ResultMatcher() { @@ -100,7 +98,7 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon return isInterrupted(); } }); - } +// } } }; } @@ -110,20 +108,10 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon } public void setFilter(PoiFilter filter) { - // TODO parameter this.filter = filter; -// this.radius = 100; -// this.path = true; - this.path = false; data.clearCache(); } - public void setFilter(PoiFilter filter, double radius) { - this.filter = filter; - this.radius = radius; - this.path = true; - data.clearCache(); - } public void getAmenityFromPoint(RotatedTileBox tb, PointF point, List am) { @@ -366,9 +354,6 @@ public class POIMapLayer extends OsmandMapLayer implements ContextMenuLayer.ICon @Override public void newRouteIsCalculated(boolean newRoute) { - if(path) { - data.clearCache(); - } } @Override diff --git a/OsmAnd/src/net/osmand/plus/views/controls/MapZoomControls.java b/OsmAnd/src/net/osmand/plus/views/controls/MapZoomControls.java index b7389a6b38..cfb22e940c 100644 --- a/OsmAnd/src/net/osmand/plus/views/controls/MapZoomControls.java +++ b/OsmAnd/src/net/osmand/plus/views/controls/MapZoomControls.java @@ -236,9 +236,9 @@ public class MapZoomControls extends MapControls { public boolean onLongClick(View notUseCouldBeNull) { final OsmandSettings.OsmandPreference zoomScale = view.getSettings().MAP_ZOOM_SCALE_BY_DENSITY; final AlertDialog.Builder bld = new AlertDialog.Builder(view.getContext()); - float scale = view.getZoomScale(); + float scale = zoomScale.get();// view.getZoomScale(); int p = (int) ((scale > 0 ? 1 : -1) * Math.round(scale * scale * 100)) + 100; - final TIntArrayList tlist = new TIntArrayList(new int[] { 75, 100, 150, 200, 300, 400, 500 }); + final TIntArrayList tlist = new TIntArrayList(new int[] {50, 75, 100, 150, 200, 300, 400, 500 }); final List values = new ArrayList(); int i = -1; for (int k = 0; k <= tlist.size(); k++) { @@ -272,7 +272,7 @@ public class MapZoomControls extends MapControls { } else { newScale = -(float) Math.sqrt((100f - tlist.get(which)) / 100f); } - zoomScale.set(newScale - (float) Math.sqrt(Math.max(view.getDensity() - 1, 0))); + zoomScale.set(newScale); view.getAnimatedDraggingThread().startZooming(view.getZoom(), view.getSettingsZoomScale(), false); dialog.dismiss(); diff --git a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java index 98b5fd2d50..aeb9eb511b 100644 --- a/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java +++ b/OsmAnd/src/net/osmand/plus/voice/TTSCommandPlayerImpl.java @@ -6,6 +6,10 @@ import java.util.List; import java.util.Locale; import java.util.Map; +import android.app.Notification; +import android.app.PendingIntent; +import android.support.v4.app.NotificationCompat; +import android.support.v4.app.NotificationManagerCompat; import net.osmand.PlatformUtil; import net.osmand.plus.OsmandApplication; import net.osmand.plus.R; @@ -27,8 +31,10 @@ import android.speech.tts.TextToSpeech; import android.speech.tts.TextToSpeech.OnInitListener; import android.speech.tts.TextToSpeech.OnUtteranceCompletedListener; + public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer { public final static String PEBBLE_ALERT = "PEBBLE_ALERT"; + public final static String WEAR_ALERT = "WEAR_ALERT"; private static final class IntentStarter implements DialogInterface.OnClickListener { private final Context ctx; @@ -132,6 +138,22 @@ public class TTSCommandPlayerImpl extends AbstractPrologCommandPlayer { log.info("Send message to pebble " + message); } + public void sendAlertToAndroidWear(String message) { + int notificationId = 1; + NotificationCompat.Builder notificationBuilder = + new NotificationCompat.Builder(mTtsContext) + .setSmallIcon(R.drawable.icon) + .setContentTitle(mTtsContext.getString(R.string.app_name)) + .setContentText(message) + .setGroup(WEAR_ALERT); + + // Get an instance of the NotificationManager service + NotificationManagerCompat notificationManager = + NotificationManagerCompat.from(mTtsContext); + // Build the notification and issues it with notification manager. + notificationManager.notify(notificationId, notificationBuilder.build()); + } + private void initializeEngine(final Context ctx, final Activity act) { if (mTts != null && mTtsContext != ctx) { diff --git a/SherlockBar/libs/android-support-v4.jar b/SherlockBar/libs/android-support-v4.jar index 187bdf48b1..c31cede47e 100644 Binary files a/SherlockBar/libs/android-support-v4.jar and b/SherlockBar/libs/android-support-v4.jar differ