Tutor/Mentor Connection

Connect knowledge, volunteers, youth and make a difference.

After updating bank part in asset map, I tried to fix Boundaries error.

It didn't work now, because of google update. 

Google map API changed last December Version2 to Version3.

I've never studied about java and google map API, so I had to study.

Actually, make a new function would be better... 

For that, I need only V3 information, but migrating v2 to v3..I must study both of them.

However, I couldn't make a new one. The codes are complexed and used in many functions and webpages.

Even if I change some tiny thing, It can make a big error. 

Fortunately, There are many sources in google. This isn't a new error. Many people had a same problem.

After studying, I want to test something, but because of wifi problem or my computer problem, 

I couldn't test them exactly. Wifi signal stopped too much, every that moment I had to reconnect to 

server computer. Also, I have to reconnect to our website. wait and reconnect and...

So I couldn't finish this. But I will try in Korea. This is what I did.

https://developers.google.com/maps/documentation/javascript/v2/v2tov3

this is the official page of google to explain their difference.

After reading that page, you will know about the difference approximately.

/span>script type="text/javascript" src="//maps.googleapis.com/maps/api/js?key=&sensor="></script>

This bootstrap didn't work so I found another one in here.

First, you have to change bootstrap line that is on top of the aspx file.

This is a v2 bootstrap in asset-map.aspx.


Change that bootstrap. The example is in here.

http://www.mywebexperiences.com/2013/03/05/migrate-google-maps-from...

In V3, API key isn't mandatory, but I recommend to use API key for V3.

You can get it in here with your google account.

https://code.google.com/apis/console

After that, you have to change programMap.js file.

It has a lot of functions for webpages.

If you read the first google official page, you will notice this.


GlatLng --> google.maps.LatLngGLatLngBounds() --> google.maps.LatLngBounds()

GPoint --> google.maps.Point

GMap2 --> google.maps.Map

GInfoWindow --> google.maps.InfoWindow

GMapOptions --> google.map.MapOptions

G_API_VERSION --> google.maps.version

GPolyStyleOptions --> google.maps.PolygonOptions or google.maps.PolylineOptions

Event.addListener --> google.maps.event.addListener

map.getInfoWindow().getPoint --> google.maps.getPosition()

markers[i].getPoint() --> markers[i].getPosition()

closeInfoWindow() --> map.InforWindow.Close();

map.getBoundsZoomLevel(bounds) --> map.fitBounds(bounds)

markers[i].setImage --> .setIcon

map.InfoWindow.close() --> create a function to close

find in maps for objects --> $('#id')[0] or $('#id').get(0) or document.getElementbyId

map.addOverlay(polyline) --> google.maps.Polyline()

 

Those codes can migrate simply. 

The problem is these.

GBounds GLanguage
GBrowserIsCompatible GLayer
GControl GLog
GControlAnchor GMercatorProjection
GControlImpl GNavLabelControl
GControlPosition GObliqueMercator
GCopyright GOverlay
GCopyrightCollection GPhotoSpec
GDownloadUrl GPolyEditingOptions
GDraggableObject GScreenOverlay
GDraggableObjectOptions GStreetviewFeatures
GFactualGeocodeCache GStreetviewLocation
GGeoAddressAccuracy GStreetviewOverlay
GGeocodeCache GStreetviewUserPhotosOptions
GGoogleBar GTileLayerOptions
GGoogleBarAdsOptions GTileLayerOverlayOptions
GGoogleBarLinkTarget GTrafficOverlayOptions
GGoogleBarListingTypes GUnload
GGoogleBarOptions GXml
GGoogleBarResultList GXmlHttp
GInfoWindowTab GXslt
GKeyboardHandler

Version3 doesn't support those codes anymore. 

So we have to change them. I mean, remove them and edit original code.

They didn't support those codes because their structure is changed.

For us, key point is polylines, custom control, GXml, GxmlHttp.

I tried to do some test for them but I didn't do that exactly.

Sometimes, while testing internet connection disconnected suddenly. 

So I couldn't see the right result.

Sometimes, while saving file disconnected suddenly.

So file didn't save or saved imperfectly.. Something is changed but other thing is not changed. 

In that condition, I couldn't do it exactly..I was in chaos;;

These links are useful for us. You can refer these pages.

https://developers.google.com/maps/documentation/javascript/v2/v2tov3

http://blog.brianjohnsondesign.com/google-maps-v3-sensor-parameter-...

http://www.mywebexperiences.com/2013/03/05/migrate-google-maps-from...

http://mymonkeydo.com/converting-google-maps-v2-to-v3/

http://stackoverflow.com/questions/9973284/migrating-my-html-google...


Stackoverflow is also good to ask something about cording.

If you're Korean, these are also good for you.

http://blog.naver.com/kdog07?Redirect=Log&logNo=10180360727

http://kyozzang.tistory.com/22

 

I used assetmap-test.aspx page. For that page, I made a ProgramMap_v3.js file.

You can test something with those files. If it works, you can apply to assetmap.aspx the original page.

Views: 163

Comment

You need to be a member of Tutor/Mentor Connection to add comments!

Join Tutor/Mentor Connection

Comment by Daniel Bassill on February 20, 2014 at 5:28pm

This is pretty sophisticated work and you accomplished a lot in the six weeks you were here in Chicago. I hope you can continue to work on this once you are back in South Korea. Thank you.

© 2024   Created by Daniel Bassill.   Powered by

Badges  |  Report an Issue  |  Terms of Service