PopUp Menu in OSM

What is the benifit of making own OSM tile server if we can’t style are own map. So here I come to tell you how to add the information(“PopUp Menu”) in your own OSM map.

So Let’s Start.

Edit the file “slippymap.html”.

The layer named “My Points”contains the information of the few shops near Gill road.

Enter the new layer just after the defination of the variable “map” in the init() function.

var pois = new OpenLayers.Layer.Text( “My Points”,
{ location:”./textfile.txt”,
projection: map.displayProjection


Here textfile.txt is the file containing information of the shops in it. The below picture shows the format of the data stored in the textfile.


Be sure the name of the image in the textfile and the image existing in the same directory should have same name.

Now refresh your map and you will be able to see the changes.



Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s