Yii Framework Forum: EGMap 2.0 Google Maps Extension - Yii Framework Forum

Jump to content

  • (13 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

EGMap 2.0 Google Maps Extension Objet-oriented PHP abstraction to the Google Maps API to ease the proc Rate Topic: ***** 5 Votes

#1 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 22 December 2010 - 12:45 PM

EGMap 2.0 has been uploaded. Please, be informed that this new version has not BC for the sake of better code. Its code has been very much reduced. Still lot of work to do but the base has been created.

Hope you enjoy it

Posted Image

Bug reports, suggestions, examples in this forum post.

Thanks for your feedback: http://www.yiiframew...xtension/egmap/

ChangeLog
Please update the libraries to EGMap 2.0

20-03-2011
- Included support for Polygons [Committer Mat Kay]
11-02-2011
- Included support for language and region maps
11-02-2011
- Included support for addDOMEventListenerOnce and addEventListenerOnce (thanks Johnatan)
03-02-2011
- Fixed small bug on the registerPlugins Functions (thanks Rangel Reale)
03-02-2011 version 1.0.0
- Code completely re-written
- KML Support
- KML Libraries included
- Most of the libraries now extend from EGMapBase
- Magic getters and setters for methods preceded by set or get (Yii style) and for its options array
- Better Clusterer Support
- Inclusion of new plugins

-----------------------------------------
Previous Versions not compatible with this one
-----------------------------------------
24-01-2011 version 1.8
- Added MapType Controls Styles and Positioning
- Fixed minor bugs throughout all the library classes
- Included EGMapPoint and EGMapSize classes to the library
- Code cleaning, improved code algorithms
- Included EGMapKeyDragZoom class to allow 'shift-click-and-drag' option
- Included EGMapControlPosition Class, now we can easily set controls on different positions on the map - Included EGMapMarkerWithLabel class to allow markers with labels
- Included EGMapMarkerClusterer class to support marker clusterer feature
- Fixed common sharing info window option. Now users can choose whether to share a common info window variable or not
- Improved options encode. Included modified version of CJavaScript::encode to properly render Google Maps options.

11-01-2011 version 1.7
- Bug Fix EGMarkerImage class
- Added Support for Global Info Window Reference. Now, only one info window is open at all times. (Thanks bitmatix)

10-01-2011 version 1.6
- Removed EGMapIcon class (deprecated for Google Maps v3)
- Modified - Added setIcon, getIcon, setShadow, getShadow functions to EGMapMarker class
- Removed deprecated functions and references on EGMap class

06-01-2011 version 1.5
- Removed global_variables dependency
- Fixed minor javascript bug for global variables
- Fixed minor naming rendering bugs (jsName)
- Included possibility to change jsName

24-12-2010 version 1.4
- Fixed marker reference when rendering multiple maps
- Fixed directions reference when rendering multiple maps
- Fixed global variables registration bug - Fixed minor rendered javascript bugs
- Fixed rendering container bug THANKS MDOMBA (Yii support really rocks!)
- Added appendTo function to add maps to a container ID in the page
- If no appendTo JQuery ID is set, Maps will be appended to document
- Removed initialization function name dependency. Now the function is related to Map Ids.

23-12-2010
-Fixed bug on getMarkersFittingZoom function
-Fixed bug on getMarkersCenterCoord function
Uploaded new version 1.1
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
1

#2 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 22 December 2010 - 12:47 PM

Looks great

Thanks for sharing
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#3 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 22 December 2010 - 12:49 PM

Thanks Gustavo! Test it and let us know... I will like to keep upgrading and be more Yii-oriented future releases.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#4 User is offline   Amit Singh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 11-December 10
  • Location:India

Posted 23 December 2010 - 12:03 PM

Works nice and easy, :)

Examples works like a charm, Thanks.

I came across the problem though

I inserted the given example code to the view ( I think that was to be done) and found that till the google maps do not respond the page shows nothing, then suddenly the whole page shows up and maps starts to load. I encounter this while testing the pages on the slow network. As a solution to this I put up the egmap example code in a different view and called it via AJAX,

with renderPartial('map') in controller I have :

<div id="egmap_0" style="width:512px;height:512px;" /> as response, as per FireBUG.

With renderPartial('map',NULL,FALSE,TRUE) in controller I have :

A blank Page(even the calling page content blanks out)with FireBUG showing

google is not defined
<!-- blueprint CSS framework -->

although browser keep showing transferring data from maps.googleapis.com

I am sure postrender is not required and was not supposed to be done.(but just tried it in case)

Thanks and Regards
Amit Singh

EDIT: Checked version 1.1, on Yii 1.1.4
0

#5 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 23 December 2010 - 12:27 PM

That might be a problem with HTML iframe, not with the plugin's architeture
Iframes blocks page onload untill its finished loaded
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#6 User is offline   Amit Singh 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 13
  • Joined: 11-December 10
  • Location:India

Posted 23 December 2010 - 12:39 PM

View PostGustavo, on 23 December 2010 - 12:27 PM, said:

That might be a problem with HTML iframe, not with the plugin's architeture
Iframes blocks page onload untill its finished loaded


I am not using iframe, maybe some other problem, I will test it again tomorrow with Yii 1.1.5, although I don't expect any improvement.

Thanks
0

#7 User is offline   Gustavo 

  • Master Member
  • Yii
  • Group: Moderators
  • Posts: 916
  • Joined: 27-July 10
  • Location:Curitiba - Brasil

Posted 23 December 2010 - 12:42 PM

Google maps does use iframe
--
Extensions:
translate modue - module to handle translations
multiActiveRecord - db selection in models
redisCache - redis cache component
mpCpanel - interact with cpanel api
mUploadify - use uploadify uploader in your application

Gustavo Salomé Silva
0

#8 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 23 December 2010 - 12:45 PM

Please, re-downloaded files, I had a couple of bugs within two functions.

As Gustavo said, Google works that way. nevertheless, try a different approach as I am trying to find out the best way to use a lazy programmers function that actually renders two or three or four maps (:()


write the HTML layer on the partial view file: <div id="my_custom_map" style="width:100%;height:300px"></div> (for example)

Then when you start the code, set the containers id: $myEGMap->setContainerId('my_custom_map')

and render the script: $myEGMap->renderScriptMap();

See if it goes so slow as you said.
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#9 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 24 December 2010 - 05:28 AM

View PostAmit Singh, on 23 December 2010 - 12:39 PM, said:

I am not using iframe, maybe some other problem, I will test it again tomorrow with Yii 1.1.5, although I don't expect any improvement.

Thanks


With renderPartial I came accross that it doesnt register the Javascript Scripts. Please check that. Thanks!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#10 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,336
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 December 2010 - 05:44 AM

I just downloaded the latest update... and like the previous one it has one more thing that needs fixing...

With your example #3 If you click on the marker on the first map... the info "I was living here as a kid" opens in the second map instead on the first one...

If you click the marker on the second map... it does nothing...
Find more about me.... btw. Do you know your WAN IP?
0

#11 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,336
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 December 2010 - 05:47 AM

End the example 1 and 2 does not work anymore... I have the webLogRute enabled... and the map appears at the very bottom of the page after the webLogRoute application log...
Find more about me.... btw. Do you know your WAN IP?
0

#12 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 24 December 2010 - 06:11 AM

View Postmdomba, on 24 December 2010 - 05:47 AM, said:

End the example 1 and 2 does not work anymore... I have the webLogRute enabled... and the map appears at the very bottom of the page after the webLogRoute application log...


// we can now render to any containers in the document, we control where
// we want it to be rendered now without coding the HTML elements for the
// Google map
// If we do not specify the container, the map will be appended to the BODY
// tag of the document

I have successfully inserted 5 maps on the page by using the examples provided, with and without appendTo tags. If you do not specify containers will be appended to the BODY. (Check internal code my friend, you are more than qualified to tell me what you see there :) )

One way to control position too is by getting the container:

$div = $gMap->getContainer();

Registering the scripts

$gMap->registerMapScript();

Echo container, wherever you want it

echo $div;

If you wish to add another one, you need to create or recreate a new EGMap Class.

Cheers Mdomba
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#13 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,336
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 December 2010 - 06:15 AM

That's why I wrote that I have enabled the webLogRoute... append to body does append to the end of the body...

IMO it's not a good option... what if in your design you have a footer... than the map will be rendered after the footer...
Find more about me.... btw. Do you know your WAN IP?
0

#14 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 24 December 2010 - 06:29 AM

View Postmdomba, on 24 December 2010 - 06:15 AM, said:

That's why I wrote that I have enabled the webLogRoute... append to body does append to the end of the body...

IMO it's not a good option... what if in your design you have a footer... than the map will be rendered after the footer...


You can change that optional behaviour by setting

$gMap->appendTo('#containerId');

Other than that, what would you suggest? Default rendering or both options? Thanks mdomba...
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#15 User is offline   Maurizio Domba Cerin 

  • Yii - Yesss It Is !!!
  • Yii
  • Group: Yii Dev Team
  • Posts: 4,336
  • Joined: 12-October 09
  • Location:Croatia

Posted 24 December 2010 - 06:31 AM

I understand the appendTo... just wanted to tell you that the call like example 1 and 2 is not usefull as it adds the map to the very end of the page...

I liked more the first idea... to render a div at the place where the extension gets called... isn't it more intuitive?

Edit: and maybe instead of appendTo... you can add a variable for the container ID to the constructor of EGMap... so that you can have both options... just a thought to simplify this...
Find more about me.... btw. Do you know your WAN IP?
0

#16 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 24 December 2010 - 06:35 AM

View Postmdomba, on 24 December 2010 - 06:31 AM, said:

I understand the appendTo... just wanted to tell you that the call like example 1 and 2 is not usefull as it adds the map to the very end of the page...

I liked more the first idea... to render a div at the place where the extension gets called... isn't it more intuitive?

Edit: and maybe instead of appendTo... you can add a variable for the container ID to the constructor of EGMap... so that you can have both options... just a thought to simplify this...


LOL!! I cannot believe it man, I have just done that!

	if(null === $this->_appendTo)
			echo $this->getContainer();


¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#17 User is offline   Alex Muir 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 96
  • Joined: 25-April 09

Posted 24 December 2010 - 02:35 PM

Great work man, this is a top extension. I'll be using it all the time.
My sites: The Big Eat and The Big Space
0

#18 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 24 December 2010 - 02:54 PM

I will add more features soon.

Stay tunned as rendering maps and simple icons isnt all it does.

Thanks for your positive feedback!
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

#19 User is offline   dr.simple 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 3
  • Joined: 03-January 11

Posted 06 January 2011 - 11:33 AM

Hello! I'm new to yii and installed your really great extension. Now I want to modify this extension - I want to add the ability to draw lines, rectangles, circles on a google map.

I was wondering which google maps api version is supported by this extension?
0

#20 User is offline   Antonio Ramirez 

  • Elite Member
  • Yii
  • Group: Yii Dev Team
  • Posts: 1,448
  • Joined: 04-October 10

Posted 06 January 2011 - 11:37 AM

Latest one, dr simple. It uses gmaps V3.

If you are able to do so, and include some classes to the library, please let me know. I would love to include them into the extension!

I wanted to actually do it my self but I had to continue with my personal projects :(
¿How long would it take for you to understand that you own nothing in this world?

www.ramirezcobos.com
www.2amigos.us
www.github.com/tonydspaniard
www.github.com/2amigos


Posted Image
0

Share this topic:


  • (13 Pages)
  • +
  • 1
  • 2
  • 3
  • Last »
  • You cannot start a new topic
  • You cannot reply to this topic

2 User(s) are reading this topic
0 members, 2 guests, 0 anonymous users