Android Open Source - helsinki-testbed2-android Location Marker S V G






From Project

Back to project page helsinki-testbed2-android.

License

The source code is released under:

GNU General Public License

If you think the Android project helsinki-testbed2-android listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package fi.testbed2.android.ui.svg;
//w w  w.j  a v a2  s  . c om
import fi.testbed2.android.app.Logger;
import fi.testbed2.util.ColorUtil;
import lombok.Getter;

/**
 * Map marker image as SVG for user location.
 * The SVG was copied from: http://www.clker.com/clipart-map-29.html
 */
public class LocationMarkerSVG {

    @Getter
    private String xmlContent;

    public LocationMarkerSVG(String colorHex) {

        double opacity = ColorUtil.getOpacityFromARGB(colorHex);
        String colorWithoutAlpha = ColorUtil.getColorWithoutAlpha(colorHex);
        int strokeWidth = 60;

        Logger.debug("LocationMarkerSVG opacity: " + opacity);
        Logger.debug("LocationMarkerSVG color: " + colorWithoutAlpha);

        xmlContent = "<?xml version=\"1.0\"?><svg width=\"2481\" height=\"2073\" xmlns=\"http://www.w3.org/2000/svg\">\n" +
                " <title>map</title>\n" +
                " <g>\n" +
                "  <title>Layer 1</title>\n" +
                "  <g externalResourcesRequired=\"false\" id=\"svg_1\">\n" +
                "   <path id=\"svg_2\" d=\"m1240.940063,1945.628906c-38.766113,-190.300781 -107.116089,-348.665039 -189.903076,-495.439697c-61.406982,-108.872314 -132.543945,-209.363281 -198.363892,-314.938232c-21.972168,-35.243896 -40.934082,-72.477051 -62.047119,-109.053955c-42.215942,-73.136963 -76.44397,-157.934814 -74.268921,-267.932007c2.124878,-107.473022 33.208008,-193.68396 78.030029,-264.171997c73.718872,-115.934937 197.200928,-210.989014 362.883911,-235.968994c135.465942,-20.42395 262.475098,14.082031 352.542969,66.748047c73.600098,43.037964 130.596069,100.526978 173.920044,168.280029c45.220093,70.715942 76.359009,154.259888 78.971069,263.231934c1.336914,55.829834 -7.804932,107.531982 -20.684082,150.417969c-13.033936,43.40918 -33.996094,79.695068 -52.645996,118.454102c-36.406006,75.658936 -82.04895,144.981934 -127.85498,214.345947c-136.437012,206.605957 -264.496094,417.309814 -320.579956,706.026855z\" stroke-miterlimit=\"10\" stroke-width=\""+strokeWidth+"\" stroke=\"#000000\" fill=\"" + colorWithoutAlpha + "\" fill-opacity=\""+opacity+"\" clip-rule=\"evenodd\" fill-rule=\"evenodd\"/>\n" +
                "   <circle id=\"svg_4\" r=\"183.332993\" cy=\"757.047\" cx=\"1239.546\" clip-rule=\"evenodd\" fill-rule=\"evenodd\"/>\n" +
                "  </g>\n" +
                " </g>\n" +
                "</svg>";
    }

}




Java Source Code List

com.larvalabs.svgandroid.ParserHelper.java
com.larvalabs.svgandroid.SVGParseException.java
com.larvalabs.svgandroid.SVGParser.java
com.larvalabs.svgandroid.SVG.java
com.robobunny.SeekBarPreference.java
com.threefiftynice.android.preference.ListPreferenceMultiSelect.java
fi.testbed2.MainModule.java
fi.testbed2.android.activity.AbstractActivity.java
fi.testbed2.android.activity.AnimationActivity.java
fi.testbed2.android.activity.MainActivity.java
fi.testbed2.android.activity.ParsingActivity.java
fi.testbed2.android.activity.TestbedPreferenceActivity.java
fi.testbed2.android.app.Logger.java
fi.testbed2.android.app.MainApplication.java
fi.testbed2.android.task.AbstractTask.java
fi.testbed2.android.task.DownloadImagesTask.java
fi.testbed2.android.task.ParseAndInitTask.java
fi.testbed2.android.task.Task.java
fi.testbed2.android.task.exception.DownloadTaskException.java
fi.testbed2.android.task.exception.TaskCancelledException.java
fi.testbed2.android.ui.dialog.AlertDialogBuilder.java
fi.testbed2.android.ui.dialog.DialogBuilder.java
fi.testbed2.android.ui.svg.LocationMarkerSVG.java
fi.testbed2.android.ui.svg.MunicipalityMarkerSVG.java
fi.testbed2.android.ui.view.AnimationViewPlayer.java
fi.testbed2.android.ui.view.AnimationView.java
fi.testbed2.android.ui.view.MapScaleInfo.java
fi.testbed2.android.ui.view.util.AnimationViewBoundsUtil.java
fi.testbed2.android.ui.view.util.AnimationViewCanvasUtil.java
fi.testbed2.android.ui.view.util.AnimationViewScaleAndGestureUtil.java
fi.testbed2.domain.MapLocationGPS.java
fi.testbed2.domain.MapLocationXY.java
fi.testbed2.domain.Municipality.java
fi.testbed2.domain.TestbedMapImage.java
fi.testbed2.domain.TestbedParsedPage.java
fi.testbed2.robotium.MainActivityRobotiumTest.java
fi.testbed2.service.BitmapService.java
fi.testbed2.service.CoordinateService.java
fi.testbed2.service.HttpUrlService.java
fi.testbed2.service.LocationService.java
fi.testbed2.service.MunicipalityService.java
fi.testbed2.service.PageService.java
fi.testbed2.service.SettingsService.java
fi.testbed2.service.impl.ApacheHttpUrlService.java
fi.testbed2.service.impl.InlineMunicipalityService.java
fi.testbed2.service.impl.LruCacheBitmapService.java
fi.testbed2.service.impl.LruCachePageService.java
fi.testbed2.service.impl.MercatorCoordinateService.java
fi.testbed2.service.impl.PreferenceBasedLocationService.java
fi.testbed2.service.impl.SharedPreferenceSettingsService.java
fi.testbed2.util.ColorUtil.java
fi.testbed2.util.MathUtil.java
fi.testbed2.util.SeekBarUtil.java
fi.testbed2.util.TimeUtil.java
net.margaritov.preference.colorpicker.AlphaPatternDrawable.java
net.margaritov.preference.colorpicker.ColorPickerDialog.java
net.margaritov.preference.colorpicker.ColorPickerPanelView.java
net.margaritov.preference.colorpicker.ColorPickerPreference.java
net.margaritov.preference.colorpicker.ColorPickerView.java