-
6 Jul 2008 4:41 PM #1
Ext.ux.GMapPanel - Google Maps
Ext.ux.GMapPanel - Google Maps
ExtJS Google Maps Panel Updated With Locale Support and More...
This is an extension that adds Google Map functionality to any panel, or panel type of component. It has been tested with both 2.x and 3.x branches and appears to work fine in both.
There are separate versions that work with the Google Maps 2.x API and the 3.x API.
Features:- Render google map to a panels body
- Add map controls
- Set map center
- Add markers
- Geocode center location or markers
- Localization for error messages
- Use any Google map type, Moon, Sky, etc.
Working on:- Add map controls via config (no instantiated) - added July 31
- Add multiple map controls - added July 31
- Add listeners for marker interaction - added July 31
- Add gmap config options - added July 31
- Document code - added August 20th
- Load KML file - added November 22nd
- Document code better - added January 27th
- Mars, Moon and Sky map support - added sky on March 19th (working on others still)
- Add more examples - added tab example on March 19th (will add more as needed), added more on April 26th
Bugs:- setCenter killing controls when lat/lng used for center point instead of geocode - fixed August 20th
- Too many to remember - fixed January 27th
- setCenter kills the map when using lat/lng - unable to locate problem as of yet
*
The UX and Example code can be found on Github
https://github.com/VinylFox/ExtJS.ux.GMapPanel/
*
Please feel free to make modifications or additions and post them back to this thread - I will integrate them with the extension.
Blog Post:http://extjs.com/blog/2008/07/01/int...pi-with-extjs/
Live Example:http://www.extjs.com/playpen/gmaps/ux.gmaps.php (uses out-dated component code)
-
6 Jul 2008 6:50 PM #2
-
6 Jul 2008 9:06 PM #3
-
7 Jul 2008 2:56 AM #4
Awesome, I created something similar a while ago with the ability to automaticly add markers from a datastore, but I din't really finish it.
-
7 Jul 2008 9:11 AM #5
Don't copy and paste from IE
Don't copy and paste from IE
This might be old news but it's the first time I've discovered it. Apparently, if you copy the code in IE and paste it into your IDE, it pastes it as one line! Yikes. It works fine in the superior Firefox browser - at least 3.0 does. So in the future, could you post a link to the JS file to make it easier for use in IE? Thanks.
-
23 Jul 2008 1:46 AM #6
Hi VinylFox,
This is an excellent extension! But i've a - maybe stupid - question, how can i POST selected Google Maps position (LAT, LANG) by SUBMIT with FormPanel?http://louise.hu / poetry / development / C, Java, JavaScript, HTML / ExtJS / Alfresco
-
23 Jul 2008 9:11 AM #7
Not a stupid question at all...what you will need is the center point from the maps handlers that Google provides. You can get a reference to the Google map by using getMap()
For example:
That would return a GMaps GLatLng object which could be used to retrieve lat/long info.Code:Ext.getCmp('yourmapid').getMap().getCenterPoint();
ie:
Hope that helps.Code:var cur_glatlng = Ext.getCmp('yourmapid').getMap().getCenterPoint(); var cur_lat = cur_glatlng.lat(); var cur_lng = cur_glatlng.lng();
-
25 Jul 2008 9:43 AM #8
thanks for the work.
I use this for map options:
just after this line
this.gmap = new GMap2(this.body.dom);
using this way:PHP Code:if(Ext.isArray(this.mapConfOpts)){
for(I=0;I<this.mapConfOpts.length;I++){
try{
eval('this.gmap.'+this.mapConfOpts[I]+'();');
}
catch(e){
alert(this.mapConfOpts[I]+' is not a map configuration method');
}
}
}
for sure not the best and clean way, but it works.PHP Code:addControl: new GSmallMapControl(),
mapConfOpts: ['enableScrollWheelZoom','enableDoubleClickZoom','enableDragging'],
.....
Davide.
-
28 Jul 2008 12:44 AM #9
Thanks, this is helpful for me!
http://louise.hu / poetry / development / C, Java, JavaScript, HTML / ExtJS / Alfresco
-
29 Jul 2008 11:03 AM #10
Beware of moving window out of bounds
Beware of moving window out of bounds
Perhaps this problem exists outside of the GMapPanel as well. But if you move the Panel outside the bounds of the browser, there might be no way to get it back. If you try to grab the panel, of course, you will simply grab the map. I put this in to prevent that:
PHP Code:listeners:{
'move':{
fn:function(){
if (this.y < 0) this.setPosition(this.x,0);
}
}
}




Reply With Quote