Hello All
I am trying to use a mapping Javascript API in a webdev application.
The API is provided by a company called leaflet. Website:
http://www.leafletjs.comThe API quick start guide has the following steps (in Javascript) for
integrating leaflet into a webpage:
Step 1. Include Leaflet CSS files in the head section of your document:
<link rel="stylesheet"
href="
http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.css" />
I have added this line into the HTML code section (Advanced Tab - under
description) of the webdev page.
Step 2.
Include Leaflet JavaScript file:
<script src="
http://cdn.leafletjs.com/leaflet-0.6.4/leaflet.js"></script>
I have added this using "Add a web resource" option in the Advanced tab
of the webdev page.
Step 3. Put a div element with a certain id where you want your map to be:
<div id="map"></div>
Not sure how to handle this statement
Step 4. Make sure the map container has a defined height, for example by
setting it in CSS:
#map { height: 180px; }
Not sure how to handle this statement
Step 5. Initialize the map and set its view to our chosen geographical
coordinates and a zoom level:
var map = L.map('map').setView([51.505, -0.09], 13);
L.tileLayer('
',
{
attribution: 'Map data © <a
href="
http://openstreetmap.org">OpenStreetMap</a>',
maxZoom: 18
}).addTo(map);
Not sure how handle the above code in webdev. I have created a
Javascript local browser procedure and added this in the procedure. How
do I assign the output of the above code to the image control on the
page? - The image control is called imgMap.
The webdev documentation seems to suggest that its possible to use
Javascript Methods using JSMethod (without having to specify the
Javascript code) but the documentation is very thin and I can't make
head or tails of it.
My main issue is I am not sure how or where to handle the image control
(imgMap) in the above javascript code.
After the execution of the above code I should see a map image in my
Image control imgMap.
Any help that will lead me in the right direction will be much appreciated.
Thanks and regards
Gautam