I am using joomla components mosetstree with Google Maps positioning for companies. Unfortunately Google Maps does not have a map of my town, but OpenStreetMap does. I don't know how to incorporate the OpenStreetMap layer, so could you please help me? Here is the code of the map page from mosetstree:
asked 12 Nov '12, 18:45 Mile SomeoneElse ♦ |
GMap, OpenLayers, and Leaflet are all used in pretty much the same way. You create a map object, initialize it with an html object to draw into and a latitude/longitude/zoom, and the rest (for your usecase) are optional niceties. See the two previous links for examples, and adapt them to your php code. Note that you don't need an API key to use OSM tiles. Alsom the map_controls are probably named differently between libraries, so you should either :
answered 13 Nov '12, 10:10 Vincent de P... ♦ I was hopping someone will help me just to insert openstreet layer within existing map file. I have basic knowledge of coding, meaning im not able to do it alone without detail instructions. However thank you !
(13 Nov '12, 15:24)
Mile
It really is quite straightforward. Follow one of the examples or tutorials on openlayer of leaflet website. The only two changes you need to make is to leave the "jQuery(document).ready(function(){initialize();});" line at the end of the script, and use php code like "<?php echo $this->link->lat ?>" instead of the lat/long/zoom values. If it doesn't work, check for javascript errors in your borwser's debug console (for example the "firebug" extension of firefox) and check for php errors in your server logs.
(13 Nov '12, 22:51)
Vincent de P... ♦
|