jOVI Testing

by mmarcon

HTML

<script src="http://api.maps.ovi.com/jsl.js"></script>
<section id="map"></section>

CSS

body {
    background: #fff;
}

#map {
    width: 500px;
    height: 500px;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -250px 0 0 -250px;
    border: 10px solid #fff;
    border-radius: 4px;
    box-shadow: 0 0 10px #ccc;
    background: #fff;
}

JavaScript

function runTest() {
    $('#map').jOVI();
};

/*
 * Copyright (c) 2011 Massimiliano Marcon, http://marcon.me
 * 
 * Permission is hereby granted, free of charge, to any person obtaining
 * a copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, sublicense, and/or sell copies of the Software, and to
 * permit persons to whom the Software is furnished to do so, subject to
 * the following conditions:

 * The above copyright notice and this permission notice shall be
 * included in all copies or substantial portions of the Software.

 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/

(function($) {
    var _maps = {},
        _counter = 0,
        _enabledEvents = {
            "click": true,
            "dblclick": true,
            "mousemove": true,
            "mouseover": true,
            "mouseout": true,
            "mouseenter": true,
            "mouseleave": true,
            "longpress": true,
            "dragstart": true,
            "drag": true,
            "dragend": true
        },
        _isPermittedEvent = function (event) {
            return _enabledEvents [event.toLowerCase()] === true;
        },
        _initMap = function(target, settings) {
            var components = [], mapID;
            //Setup components based on settings
            if (settings.behavior) {
                components.push(new ovi.mapsapi.map.component.Behavior());
           ...