uT2k4
Messages postés10Date d'inscriptionmercredi 9 décembre 2009StatutMembreDernière intervention21 mai 2010
-
17 mai 2010 à 14:46
jbashh
Messages postés5Date d'inscriptionjeudi 25 septembre 2003StatutMembreDernière intervention 7 mai 2011
-
7 mai 2011 à 06:38
Bonjour,
Je voulais integrer google map sur mon site full-flash codé en AS2.
Après moulte recherches j'ai trouvé google map API codé en as2 youhou, ça fonctionne !
Le probleme c'est qu'il faut cliquer sur un bouton "create" pour que la carte apparaisse, puis ensuite sur le bouton "enlarge" pour qu'elle ai une dimension convenable.
J'aimerais pouvoir supprimer tout ces artifices : il me faut juste la carte qui apparait dès que je charge son swf et qu'elle ai aussi directement la taille que l'on obtient après avoir cliqué sur le bouton "enlarge".
J'ai beau déplacer des ligne de codes, supprimer les fonctions... etc
je n'arrive pas au résultat souhaité ( de plus, moi et la prog, ça fait 2 ...).
J'aimerais savoir si quelqun'un pourrait me donner un petit coup de pouce.
Merci d'avance. :Hola:
Voici le code :
function create():Void{
//Make a few new pins
var newList:Array = new Array();
var dealerList:Array = new Array();
var tempData1:Object = new Object();
tempData1.pinID = "d1"
tempData1.longitude = 0.0692654;
tempData1.latitude = 45.6000319;
tempData1.pinType = "dealer";
tempData1.pinCopy = "Transports Vignaud"
tempData1.minZoom = 9;
tempData1.maxZoom = 0;
tempData1.pinClickFunction = "pinClicked"
tempData1.pinClickFunctionScope = this
tempData1.childPins = null;
newList.push(tempData1);
dealerList.push(tempData1)
var tempData:Object = new Object();
tempData.pinID = "c3"
tempData.longitude = 0.0692654;
tempData.latitude = 45.6000319;
tempData.pinType = "city";
//The minimum and maxim views you will see this pin at.
//If nothing is specified then this pin will always been shown.
tempData.minZoom = 17;
tempData.maxZoom = 10;
tempData.pinCopy = "ZI Le Plessis"
tempData.pinClickFunction = "zoomOnPins"
//if you give pins child pins when you click this pin it will zoom to those pins
tempData.childPins = dealerList;
newList.push(tempData);
//Attach the map
this.attachMovie("googlemap", "googlemap_mc",this._parent.getNextHighestDepth());
//Add any pins we created
googlemap_mc.mapPins = newList;
//Tell the map to render
googlemap_mc.startMap();
}
function destroy():Void{
//The destroy command removes any events that might have been firing.
googlemap_mc.destroy();
//Remove the movieclip from the stage.
googlemap_mc.removeMovieClip();
}
function reset():Void{
//Call the shrink method to reset the view;
shrink();
//Zoom in on the pins we were viewing
googlemap_mc.zoomOnPins();
}
function enlarge():Void{
googlemap_mc._x = 10;
googlemap_mc._y = 10;
googlemap_mc.setMapSize(620, 380)
}
function shrink():Void{
googlemap_mc._x = 20;
googlemap_mc._y = 40;
googlemap_mc.setMapSize(600, 240)
}
create_btn.onRelease = function(){
destroy();
create();
reset();
uT2k4
Messages postés10Date d'inscriptionmercredi 9 décembre 2009StatutMembreDernière intervention21 mai 2010 17 mai 2010 à 14:48
Désolé je n'avais pas vu le magnifique bouton pour mettre du code :
function create():Void{
//Make a few new pins
var newList:Array = new Array();
var dealerList:Array = new Array();
var tempData1:Object = new Object();
tempData1.pinID = "d1"
tempData1.longitude = 0.0692654;
tempData1.latitude = 45.6000319;
tempData1.pinType = "dealer";
tempData1.pinCopy = "Transports Vignaud"
tempData1.minZoom = 9;
tempData1.maxZoom = 0;
tempData1.pinClickFunction = "pinClicked"
tempData1.pinClickFunctionScope = this
tempData1.childPins = null;
newList.push(tempData1);
dealerList.push(tempData1)
var tempData:Object = new Object();
tempData.pinID = "c3"
tempData.longitude = 0.0692654;
tempData.latitude = 45.6000319;
tempData.pinType = "city";
//The minimum and maxim views you will see this pin at.
//If nothing is specified then this pin will always been shown.
tempData.minZoom = 17;
tempData.maxZoom = 10;
tempData.pinCopy = "ZI Le Plessis"
tempData.pinClickFunction = "zoomOnPins"
//if you give pins child pins when you click this pin it will zoom to those pins
tempData.childPins = dealerList;
newList.push(tempData);
//Attach the map
this.attachMovie("googlemap", "googlemap_mc",this._parent.getNextHighestDepth());
//Add any pins we created
googlemap_mc.mapPins = newList;
//Tell the map to render
googlemap_mc.startMap();
}
function destroy():Void{
//The destroy command removes any events that might have been firing.
googlemap_mc.destroy();
//Remove the movieclip from the stage.
googlemap_mc.removeMovieClip();
}
function reset():Void{
//Call the shrink method to reset the view;
shrink();
//Zoom in on the pins we were viewing
googlemap_mc.zoomOnPins();
}
function enlarge():Void{
googlemap_mc._x = 10;
googlemap_mc._y = 10;
googlemap_mc.setMapSize(620, 380)
}
function shrink():Void{
googlemap_mc._x = 20;
googlemap_mc._y = 40;
googlemap_mc.setMapSize(600, 240)
}
create_btn.onRelease = function(){
destroy();
create();
reset();
}
destroy_btn.onRelease = function(){
destroy();
}
reset_btn.onRelease = function(){
reset();
}
zoom_in.onRelease = function(){
googlemap_mc.zoom = googlemap_mc.zoom-1;
}
zoom_out.onRelease = function(){
googlemap_mc.zoom = googlemap_mc.zoom+1;
}
enlarge_btn.onRelease = function(){
enlarge();
}
shrink_btn.onRelease = function(){
shrink();
}
north_btn.onRelease = function(){
googlemap_mc.moveNorth();
}
east_btn.onRelease = function(){
googlemap_mc.moveEast();
}
west_btn.onRelease = function(){
googlemap_mc.moveWest();
}
south_btn.onRelease = function(){
googlemap_mc.moveSouth();
}
function pinClicked():Void{
trace("pinClicked");
}