appyoumake / Appyoumake

Nyeste MLAB
Other
1 stars 0 forks source link

Komponenter: Google maps dialog boks for å sette parameter #121

Closed leadermontanus closed 10 years ago

leadermontanus commented 10 years ago

Legge til dialog boks for å søke/legge inn koordinater eller legge inn URL (for rute for eksemple), velge hva som skal synes (zoom, etc).

Også dialog boks for å sette inn nåler.

leadermontanus commented 10 years ago

Mulig alternativ er Norgestkart, <iframe src="http://www.norgeskart.no/dynamisk-med-navigasjon.html#6/373526/7205898/+embedMaskLayer/+pekere+embed.box" width="690" height="520" title="Test" longdesc="Test mer"></iframe>

leadermontanus commented 10 years ago

BUG where mlab data type not picked up correctly on loaded map (not created) when click on it

For jQuery style components we add JS (and potentially CSS) files to the app, and load these, however this will not work for Google Maps as it needs to load stuff directly from Google to initialise correctly.

Need to go back to basics and embed JS in html.txt (which was always the right way to do it, but most of the recent apps have been about manipulating HTML at design time).

So, need to:

1: Store the map object in a global store so can manipulate it. * Get GUID in onCreate * Store in div tag and use as ID * Use for storage identifier also 2: Must make each div unique and pass relevant control to Google Mpas init code 3: Build dialog box for settings (centre, show marker, show zoom, etc, also add own buttons outside map like start tracker, etc) 4: Long term, store data for tracking, wait for Snapper 5: Also load this tracker data when return to page

leadermontanus commented 10 years ago

Hmmm, hmmm, hmmm.

This needs more careful thinking to work properly independent and in a modular way.

We need to use the required_libs to load the core functionality for creating a map. This will be loaded both at design and runtime.

Then there is the matter of the google hosted file. It is loaded asynch, but we should be able to create the map manually AFTER it has loaded.

So we should add this as a required lib to the include.js file (see "//2.5: copy across any runtime dependencies, can be JS or CSS" in appcontroller.php), but not try to copy it. Perhaps for this we need a 3rd type of reuqired libs, runtime_external which just updates the include...

Then at designtime we need to wait until the lib has been loaded, then run the init code. This can be done by using the callback param when loading gmaps initial lib... But what about when we load the comp again when reopen page??

Need perhaps to add functionality to load libs at designtime and wait until loaded before run function. This would emulate rt behaviour so could use same code after loaded. Does jq support getscript/load functionality?

Also, distingish between first map when download external lib and following maps... should use identical code after it is loaded...

Furthermore, need to replace scriptcode so need to have guid both for div and script. then when user makes changes to map we also update that script code, in onsave perhaps by reding zoom, center etc.

NO:Think need to generate code to add after div which distinguishes beteen dt/rt and uses

leadermontanus commented 10 years ago

Getting close on the deisgn side. Need to sort out loading of Google API file when reload the page, currently it is in onCreate, may need to move to onload...

To do this just reorg where assign config, etc.

Then add popup for properties, and close to done...

Must add check for design time and only load API file then. Runtime we do this: http://stackoverflow.com/questions/21997604/jquery-mobile-google-maps-showing-intermittently

Re size issue: http://stackoverflow.com/questions/21552308/set-content-height-100-jquery-mobile/21553307#21553307

leadermontanus commented 10 years ago

All working now!