0

I am using OpenGeo and OpenLayers 3. I managed to set a WMS layer from PostGis (Configure new SQL view) where I show points from coordinates I have in database. I also managed (following tutorial on docs.geoserver) to set the custom icon as graphic.

The next step is that this graphic icon changed on mouse over. I understand, that only image is transferred to client from GeoServer since I am using WMS. But there must be a way to do that. Is it? I think I must use WFS, but maybe I am wrong. What then? There are not plenty examples for OpenLayers3.

Icon style:

   <FeatureTypeStyle>
     <Rule>
       <PointSymbolizer>
         <Graphic>
           <ExternalGraphic>
             <OnlineResource
               xlink:type="simple"
               xlink:href="image.png" />
             <Format>image/png</Format>
           </ExternalGraphic>
           <Size>32</Size>
         </Graphic>
       </PointSymbolizer>
     </Rule>
   </FeatureTypeStyle>
1

You would have to use WFS to get the effect you want. Unfortunately, I haven't looked at much version 3 code, but in version 2, you would create client-side default and highlight styles with an icon. You would then add a select control to the layer with "hover" set to true.

Hope this gives you some ideas.

  • Yes I already did this in OpenLayers 2. But I am building a page, that will go online in a year, so I decided to use OpenLayers 3. – Makla Apr 9 '14 at 7:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.