I load a map with data and collect information in a JSON file. I want a tooltip appear when mousing over a town on the map.

   var vecLayer = new OpenLayers.Layer.Vector("vector", {
        styleMap: styleMap,
        protocol: new OpenLayers.Protocol.HTTP({
            // url: "app/data/summits.json",
            //url: "app/data/chargeIndicateur.php",
            url: "../web/app_dev.php/json/indicateur/"+gIndicateur+"/"+gEchelle+"/"+gPeriode,
            format: new OpenLayers.Format.GeoJSON(),
            idProperty: 'Issam'


, {
// dock: 'right',
xtype: 'toolbar',
id    : 'teste2',

items: [{
text: 'Nom',
labelStyle: 'font-weight:bold;',
} ,
  • my email can be find in my user profile – Sorin Călinică Feb 14 '14 at 20:20

You can see here a tooltip showing different properties from a GeoJSON file. Also, reading this article will help you to adapt your code to your needs.

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.