Jump to content

Search the Community

Showing results for tags 'getProperties'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • W3Schools
    • General
    • Suggestions
    • Critiques
  • HTML Forums
    • HTML/XHTML
    • CSS
  • Browser Scripting
    • JavaScript
    • VBScript
  • Server Scripting
    • Web Servers
    • Version Control
    • SQL
    • ASP
    • PHP
    • .NET
    • ColdFusion
    • Java/JSP/J2EE
    • CGI
  • XML Forums
    • XML
    • XSLT/XSL-FO
    • Schema
    • Web Services
  • Multimedia
    • Multimedia
    • FLASH

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests


Languages

Found 1 result

  1. Hello everybody! I'm working with openlayers 3 and I have several features, such as buildings, sewers, etc in my map. This features contain differents elements with values which have been put for me, such as name, coordinates, etc. My purpose was get this information of this features and I got it, but only in console.log. I want to visualize this information but in a innerHTML. I 've tried to put this in my code: if (feature) { content.innerHTML = feature.getProperties(); return container.style.display = 'block'; } getProperties get an object of all property names and values and returns an Object. More information here: http://openlayers.org/en/master/apidoc/ol.Feature.html?unstable=true#getProperties With this code, when I click on the features I obtain: [object Object]. But I could check with console.log that when I click on the features, info is ok: if (feature) { console.log(feature.getProperties()); return container.style.display = 'block'; } Another way to get information is change the code such as: if (feature) { content.innerHTML = feature.getId() + ': ' + feature.get('name'); return container.style.display = 'block'; } But it's not the correct way to do it because each feature has different data. So, my question is: How could I show the feature data? I mean, the same info which appears using console but with innerHTML or something similar. Thank you very much!
×
×
  • Create New...