Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <script type="text/javascript" charset="UTF-8" src="http://api.maps.nokia.com/2.2.4/jsl.js?with=all"></script>
- <script>
- //Minimal Settings of the Nokia Maps this are the codes for MyMaps
- nokia.Settings.set("appId", "mKxkNlWcmcRsAsT4n279");
- nokia.Settings.set("authenticationToken", "bScqDUhLaTjaTI5gEFfh0w");
- </script>
- </head>
- <body>
- <div id="map" style="position: relative; width: 90%; height: 400px; margin: auto;"></div>
- <script>
- display = new nokia.maps.map.Display(document.getElementById("map"),
- {
- "components": [
- new nokia.maps.map.component.ZoomBar(),
- new nokia.maps.map.component.Behavior(),
- new nokia.maps.map.component.TypeSelector()
- ]
- });
- var zoomTo = function (data, status) {
- if (status == "OK") {
- var locations = data.results.items;
- for (var i = 0, len = locations.length ; i < len ; i++) {
- if ( "administrative-region" == locations[i].category.categoryId){
- map.zoomTo(nokia.maps.geo.BoundingBox.coverAll
- ([locations[i].boundingBox.topLeft,
- locations[i].boundingBox.bottomRight ]), false);
- break;
- }
- }
- } else {
- alert("The search request failed");
- }
- };
- var term = "El Salvador";
- nokia.places.search.manager.findPlaces({
- searchTerm: term,
- onComplete: zoomTo ,
- boundingBox: {
- topLeft: {
- latitude: 85,
- longitude: -179.99
- },
- bottomRight: {
- latitude: -85,
- longitude: 179.99
- }
- }
- });
- </script>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement