tags:

views:

252

answers:

2

I am totally confused with this openlayers map. Even there are many examples and wiki, i could not find how to reuse it. I mean i want to show my city map with managable by admin, admin can add points and locations and it should displayed in front end. Please please help me how to do it?

+1  A: 

You can check out the "draw features" example to see how to make points. You enable this for admin, store the geometries of the vector layer where you are drawing your cities in a hidden field using the OL parser, and on submit you store this in a geospatially enabled database.

When displaying the map, you get the geometries from the database, read them with the OL parser, and put them on the vector layer of the map. The JSON parser can be found here: http://dev.openlayers.org/releases/OpenLayers-2.8/doc/apidocs/files/OpenLayers/Format/JSON-js.html

OL is just a front end. You can't expect it to do any back end work for you.

Conley Owens
Hi, thanks for your reply @Conely. Yes i do understand that admin cant have too friendly options to give points to specify any locations. I checked all the examples and there we can draw symbols, can load map from various services like google. But i couldnot find the way to input my city and inner locations any where. Thats what my big problem. And can you please explain me whats that OL parser.
Ela
I added a link to a parser, because I realize that's a little hard to find on a Google search, but ditto what Chau said.
Conley Owens
+3  A: 

Like Conley writes, OpenLayers is mainly a JavaScript utility for displaying geographical data. Thus it requires that you have access to the geographical data you want to display. OpenStreetMap and Google Maps are free, and there are plenty of examples discussing how to use them -> here or on OpenLayers.org.

I would suggest that you focusing on displaying the data (your city map), and then implement the admin part where you use OpenLayers for adding geometry like points, lines and polygons afterwards. Remember that if you want to store geometry, you will need a server like GeoServer or similar.

Happy mapping :)

Chau
Hi, thanks for your reply @Chau, so it means it needs lot of time to implement a map for my own purpose. I have to find a way to use it. Please tell me how to and where to start?
Ela
Go take a look at the examples at OpenLayers.org. Try to extract what you need from them, and when asking questions here at StackOverflow.com, try to post small simple questions about the problems you encounter. This will lead to more answers, since it (for us) will be a matter of giving you a simple answer and not describing the entire process for you. You will need to do the work - we can answer your questions during your progress.
Chau
yeah,thanks for the reply @chau. I will work it out.
Ela