Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class API {
- constructor(url,type,dataType, map){
- this.url = url;
- this.type = type;
- this.dataType = dataType;
- this.map = map;
- }
- ajaxMethode(){
- $.ajax({
- url : this.url,
- type : this.type,
- dataType : this.dataType,
- success : function(APIjcd,statut){
- // allStations = APIjcd;
- APIjcd.forEach(function(station){
- this.map.createStation(station);
- }.bind(this))
- this.map.markerListener('click');
- this.map.markerCluster();
- }.bind(this)
- })
- }
- }
- $(function(){
- var map = new MapInterface(document.getElementById('map'));
- map.initMap({ center: {lat: 43.600000, lng: 1.433333}, zoom: 16 });
- // VAR ajax
- var APIjcd = new API($url,'GET','JSON', map);
- APIjcd.ajaxMethode();
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement