How to set GIF Image to the GeoPoint

Hi…
I want to set Custom GIF Image for the GeoPoint. Please guide me how to do this…

Hi, @Narayanan

You need to specify the styleProvider for the vector layer containing geo-points.
It can be done in a screen controller.

For example:

    @Install(to = "map.locationLayer", subject = "styleProvider")
    private GeometryStyle locationLayerStyleProvider(Location location) {
        return new PointStyle(
                new ImagePointIcon("file:/Users/shalyganov/Pictures/icon.gif")
                        .setIconSize(40, 40));
    }

You need to pass the source of the image for the point’s icon in the ImagePointIcon constructor.

In the example above, the image is served from file system, so the prefix is: file:. You can also use theme: and classpath: prefixes, which are described here.

Hi @shalyganov
I think something changed because neither your example, nor the official docs, works as expected.

I have a warning that says “CUBA: unable to find installation point for the delegate”, and in fact the styleProvider delegate is not present in the list of available options.

I’ve also tried something like:

        VectorLayer<Luogo> vectorLayer = map.getLayer("positionLayer");
        vectorLayer.setStyleProvider(luogo -> new PointStyle(new FontPointIcon(icons.get(CubaIcon.MAP_PIN)).setIconPathFillColor("#08a343").setIconPathStrokeColor("#08a343")));

in the BeforeShowEvent with no success.

Can you tell me what changed in the latest map version, and why this doesn’t work as advertised?

Thx for your support.
P.

I’ve found the problem, it wasn’t in the provider itself, but in the Point attribute… the coordinates were not saved correctly.
The style provider now works as expected.

Thx, P.

Hi, @pfurini

I was typing the answer, when you posted that you’d figured it out :blush:

This is because at the moment Maps add-on doesn’t provide the Studio metadata to support its handlers (delegates, events) in the Studio. The good news is that we have already implemented this and after the next release of the Maps add-on it will be fully supported by the Studio.

Regards,
Gleb