Load Cutom Marker Icon From URL (OSM)

Viewed 17

I am using OpenStreetMap, I am able to load custom icons (multiple) from drawable using the following code:

    startMarker = new Marker(map);
    startMarker.setPosition(new GeoPoint(latitude,longitude));
    startMarker.setAnchor(Marker.ANCHOR_CENTER, 1.0f);
    startMarker.setTitle((intMarkerID+"").trim());
    startMarker.setIcon(getResources().getDrawable(R.drawable.loading));
    map.getOverlays().add(startMarker);

I would like to use Picasso or Glide to load marker icons from URL, I already have the URLs in a string format from an array, I just need to apply these strings url_abs_fileName ("Image URLs") as a marker icon for OpenStreetMap (Not Goolge Maps), how can I achieve that?

I need to set OSM icons to something like this (example):

        if (url_abs_fileName != null) {
        Picasso.with(this)
                .load(url_abs_fileName)
                .placeholder(R.drawable.loading)
                .into((Target) startMarker);
    }
0 Answers
Related