[MapQuery] Adding colored vectors to a map

David Lozano david.lozano.ruiz at gmail.com
Wed Feb 8 11:38:01 EST 2012


Hi all,

I'll start telling you that I'm a complete newby to mapquery, so maybe this
question has a very simple response, but I've been unable to find it.

I'm creating a map using mapquery. Relevant source code is:

$('#map').mapQuery({
  center: {
    box: [5.75, 47, 15, 55]
  },
  layers:  [{
    type: 'json',
    url: 'germany.geojson',
    label: 'Germany'
  }]
});

this simple code shows me a centered map of Germany.

Now, I want to add colored points at certain cities (red or green points,
depending of some values)... but I'm not able to add these points to the
map.

At most, I've been able to add these points adding a new json layer to
layers list, with a different url (stations.php). This PHP file generates a
file like this one:

{
 "type": FeatureCollection",
 "features": [{
  "type": "Feature",
  "geometry": {
   "type": "Point",
   "coordinates": [x, y]
   }
 }]
}

That way I can add the points, but I've found no way to apply colour to
these points. I've tried adding an "style" property to the feature, but it
doesn't work.

It shouldn't be too complicated, but I've no clue... any help?

Thanks a lot!

David (aka sharcashmo)
-- 
<http://hphayquedecirlomas.wordpress.com/>

HIJOS DE PUTA! Hay que decirlo más... Haz click en la imagen para decirlo
más
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/mapquery/attachments/20120208/dd48998a/attachment.html


More information about the MapQuery mailing list