stamen / modestmaps-js

Modest Maps javascript port
http://modestmaps.com
566 stars 152 forks source link

displaying geojson "features" #133

Closed efc closed 12 years ago

efc commented 12 years ago

Mapping neophyte here, feel free to point me off to the best beginner resources...

I am trying to use ModestMaps to display a map with both markers and features described in geojson files. I've been able to display markers easily enough, but it has been harder for me to see how to integrate geojson "features", objects with geo boundaries. Here is one example:

{ "type": "FeatureCollection", "features": [ { "type": "Feature", 
"properties": { "Name": "ST. PAUL  W-1 P-13", "Description": "1-13" }, 
"geometry": { "type": "MultiPolygon",
"coordinates": [ [ [ [ -93.124019, 44.941317 ], [ -93.123656, 44.941320 ], [ -93.121937, 44.941326 ], [ -93.121211, 44.941326 ], [ -93.120006, 44.941330 ], [ -93.118913, 44.941330 ], [ -93.118913, 44.941330 ], [ -93.118663, 44.941330 ], [ -93.118645, 44.941330 ], [ -93.118625, 44.941330 ], [ -93.118358, 44.941333 ], [ -93.118022, 44.941353 ], [ -93.117972, 44.941356 ], [ -93.117862, 44.941416 ], [ -93.117670, 44.941519 ], [ -93.117657, 44.941526 ], [ -93.117595, 44.941560 ], [ -93.117121, 44.941816 ], [ -93.116102, 44.942366 ], [ -93.116064, 44.942386 ], [ -93.116064, 44.942417 ], [ -93.116074, 44.943399 ], [ -93.116076, 44.943605 ], [ -93.116085, 44.944412 ], [ -93.116095, 44.945391 ], [ -93.116975, 44.945395 ], [ -93.118663, 44.945403 ], [ -93.121272, 44.945408 ], [ -93.123718, 44.945405 ], [ -93.126264, 44.945401 ], [ -93.126257, 44.944933 ], [ -93.126252, 44.944587 ], [ -93.126249, 44.944386 ], [ -93.126244, 44.944039 ], [ -93.126235, 44.943381 ], [ -93.126232, 44.943174 ], [ -93.126232, 44.943154 ], [ -93.126230, 44.943060 ], [ -93.126220, 44.942372 ], [ -93.126220, 44.942367 ], [ -93.126219, 44.942264 ], [ -93.126203, 44.941345 ], [ -93.126203, 44.941316 ], [ -93.124019, 44.941317 ] ] ] ]
 } } ] }

I imagine being able to add these to the map, dress them up like I do markers (but with different attributes, like background color, border width and color, etc.), and interact with them (popup on click, etc.). Is there a way to do this with ModestMaps? Should I check out another framework? Am I just missing something obvious due to having only a couple days of geo fiddling under my belt?

I'd appreciate anything from a way to get this done to advice about even the terms to use to describe the problem. For example, I tend to think of this as "layers" on the map, but the them "layers" seems to mean something quite different in these frameworks (usually referring to the tile provider or some such). Thanks!

tmcw commented 12 years ago

Hey,

Probably the most straightforward way to do this is with Leaflet, but you can also use mmg to put points on modestmaps maps pretty easily. With MMG, you can either use CSS to change the pointer style, or use customizable points (like on the home page) which are serverside-generated images.