Odoo Help

Welcome!

This community is for beginners and experts willing to share their Odoo knowledge. It's not a forum to discuss ideas, but a knowledge base of questions and their answers.

0

Embed JS code Odoo 8

By
Mazhar Iqbal Rana
on 2/10/15, 3:03 AM 877 views

Hey Good day

 

I want to embed the below cod ein my module named as vessel track

 

I have the init,openerp, module, and view files made with me.

 

PLease guide that will this code be directly applicable or in which view will it be?

 

I want to open and show this direct as a map or kanban view on clicking the module name from menu item above.

No form view no list view needed

 

Code:

<script type="text/javascript">
// Map Size
var width='800';  // width of the embedded map in pixels (min. 600 px) or percentage (default=600px)
var height='500'; // height of the embedded map in pixels (min. 400 px) (default=400px)
// Map View (does not work if Ship Selection is used)
var latitude='40.0'; // coordinates of the map center in decimal degrees (not mandatory)
var longitude='2.0';
var zoom='2';        // map zoom level (between 2 and 17)
// Ship selection
// IMPORTANT: USE ONLY ONE OF THE FOLLOWING OPTIONS
// Option 1 – by MMSI
var mmsi='xxxxxxxxx';      // center map over selected vessel specified by MMSI
var show_track=true;       // show track of the selected ship
// Option 2 – by IMO
var imo='xxxxxxx';         // center map over selected vessel specified by IMO
var show_track=true;       // show track of the selected ship
// Option 3 – display user fleet ships
var fleet='your fleet id'; // your fleet key (default is false)
var fleet_hide_old_positions=false; // Hide ships with old positions (default is false)
// Auxiliary parameters
var names=false; // always display ship names (default is false)
var click_to_activate=true; // user has to click on the map before zooming with mouse wheel
var store_position=false; // store the last position of the map (default is false, does not work when ship selection is used
var default_maptype=1; // change default map type: 1 - google.maps.MapTypeId.ROADMAP, 2 - google.maps.MapTypeId.SATELLITE
var map_style=[ // use this tool for custom map styling
{"featureType": "landscape.natural.landcover", "stylers": [{ "hue": "#ffaa00" }]},
{"featureType": "water", "stylers": [{ "hue": "#00a1ff" },{ "saturation": 91 },{ "lightness": -18 }]}];
</script>
<script type="text/javascript" src="http://www.vesselfinder.com/aismap.js"></script>

 

Your Answer

Please try to give a substantial answer. If you wanted to comment on the question or answer, just use the commenting tool. Please remember that you can always revise your answers - no need to answer the same question twice. Also, please don't forget to vote - it really helps to select the best questions and answers!

About This Community

This community is for professionals and enthusiasts of our products and services. Read Guidelines

Question tools

1 follower(s)

Stats

Asked: 2/10/15, 3:03 AM
Seen: 877 times
Last updated: 3/16/15, 8:10 AM